forked from deepzz0/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
119 lines (90 loc) · 4.09 KB
/
.tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# .tmux.conf for tmux. maybe it worked well for osx.
# url: https://github.com/deepzz0/dotfiles/blob/master/.tmux.conf
# email: deepzz.qi@gmail.com
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
set-window-option -g mode-keys vi
# mouse behavior
set-option -g mouse on
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
# window 0, 1, 2, remove 1, renumber to 0, 1
set-option -g renumber-windows on
# default window start number: 1
set-option -g base-index 1
# color
set-option -g default-terminal screen-256color
bind-key : command-prompt
bind-key r refresh-client
bind-key L clear-history
# use vim-like keys for splits and windows
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
bind-key a last-pane
bind-key q display-panes
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key L resize-pane -R 5
# uncomment below stanza to enable smart pane switching with awareness of vim splits
# bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
# bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
# bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
# bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# bind C-l send-keys 'C-l'
# window setting, layout, manage
set-window-option -g other-pane-height 25
set-window-option -g other-pane-width 80
set-window-option -g window-status-current-fg magenta
set-window-option -g display-panes-time 1500
bind-key c new-window
bind-key t next-window
bind-key T previous-window
bind-key C-o rotate-window
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
bind-key enter next-layout
# copy mode in tmux
bind-key [ copy-mode
bind-key ] paste-buffer
# Setup 'v' to begin selection as in Vim
# Applications in terminal may access clipboard option set.
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Enable native Mac OS X copy/paste
set-option -g default-command "reattach-to-user-namespace -l ${SHELL}"
# Status Bar
set-option -g status-interval 1
set-option -g status-left ''
set-option -g status-right '%l:%M%p'
set-option -g status-fg default
# Status Bar solarized-dark (default)
set-option -g status-bg black
set-option -g pane-active-border-fg "#55ff55"
set-option -g pane-border-fg "#74fc65"
# Status Bar solarized-light
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white"
# Set window notifications
set-window-option -g monitor-activity on
set-option -g visual-activity on
# Fix to allow mousewheel/trackpad scrolling in tmux 2.1
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# Disable assume-paste-time, so that iTerm2's "Send Hex Codes" feature works
# with tmux 2.1. This is backwards-compatible with earlier versions of tmux,
# AFAICT.
set-option -g assume-paste-time 0
# https://wiki.archlinux.org/index.php/Tmux#Urxvt_middle_click
# https://github.com/tmux/tmux