-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
176 lines (158 loc) · 5.5 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#
# tmux(1) configuration - expects shell to set pane titles, see tmux(1)
#
# copy-mode-vi bindings need EDITOR to contain "vi", s/-vi/-emacs/g otherwise.
#
# Testing
bind r source ~/.tmux.conf \; display '~/.tmux.conf reloaded'
# Base bindings
unbind C-b
set -g prefix C-j
bind j send-prefix
bind C-j last-window
bind C-d detach-client
bind b set-option status
bind C-s setw synchronize-panes \; \
display "synchronize-panes #{?pane_synchronized,on,off}"
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# Copy/paste
bind e copy-mode
bind P paste-buffer
bind y run 'tmux set-buffer "$(xclip -o -sel p)"'
bind Y run 'tmux set-buffer "$(xclip -o -sel c)"'
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi C-v \
send-keys -X begin-selection \; \
send-keys -X rectangle-toggle
bind -T copy-mode-vi r send-keys -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -i -sel p'
bind -T copy-mode-vi Enter \
send-keys -X copy-pipe 'xclip -i -sel p' \; \
send-keys -X copy-pipe-and-cancel 'xclip -i -sel c'
bind C-p run 'xclip -o -sel p | xclip -i -sel c > /dev/null'
bind C-y run 'xclip -o -sel c | xclip -i -sel p > /dev/null'
# Don't exit copy mode on mouse drag end event
bind -T copy-mode-vi MouseDown1Pane \
select-pane \; \
send-keys -X copy-pipe 'xclip -i -sel p' \; \
send-keys -X clear-selection
unbind -T copy-mode-vi MouseDragEnd1Pane
# Activate copy mode on double/triple click
bind -T root DoubleClick1Pane if -F -t {alternate_on} '#{mouse_any_flag}' \
'send-keys -M' 'copy-mode -t {mouse}; send-keys -X select-word'
bind -T root TripleClick1Pane if -F -t {alternate_on} '#{mouse_any_flag}' \
'send-keys -M' 'copy-mode -t {mouse}; send-keys -X select-line'
# Create 1+2 panes, horizontal layout
bind C-w \
split-window -d -v -t 1 -c "#{pane_current_path}" \; \
split-window -d -h -t 2 -c "#{pane_current_path}"
# Create 1+2 panes, vertical layout
bind C-q \
split-window -d -h -t 1 -c "#{pane_current_path}" \; \
split-window -d -v -t 2 -c "#{pane_current_path}"
# Create 2x2 panes, tiled
bind C-a \
split-window -d -v -t 1 -c "#{pane_current_path}" \; \
split-window -d -h -t 2 -c "#{pane_current_path}" \; \
split-window -d -h -t 1 -c "#{pane_current_path}"
# Display pane details
bind Q display "Pane #{pane_index} - #{pane_current_command} : #{pane_width}x#{pane_height}"
# Mouse
set -g mouse off
bind C-m set -g mouse \; display "mouse #{?mouse,on,off}"
# Move windows
bind < swap-window -t -1
bind > swap-window -t +1
# Navigation
bind S choose-tree -GZ \
-F "#{?window_flags,#{window_flags},} #W #T"
bind W choose-tree -Z \
-F "#{?window_flags,#{window_flags},} #W #T"
bind -n M-h previous-window
bind -n M-l next-window
bind -n M-j select-pane -t :.-
bind -n M-k select-pane -t :.+
#bind -n C-Left previous-window
#bind -n C-Right next-window
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Down select-pane -D
bind -n M-Up select-pane -U
# Nested sessions
bind -T off F12 set -u prefix \; set -u key-table
bind -T root F12 set prefix None \; set key-table off
# Renumber windows on request only
bind R move-window -r
set -g renumber-windows off
# Resize pane
bind -n M-y resize-pane -L 2
bind -n M-o resize-pane -R 2
bind -n M-u resize-pane -D 1
bind -n M-i resize-pane -U 1
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# Scrolling
bind -n C-Up copy-mode -e
bind -n C-Down send-keys ""
bind -n M-PageUp copy-mode -e
bind -n M-PageDown send-keys ""
bind -n S-PageUp copy-mode -eu
bind -n S-PageDown send-keys ""
bind -T copy-mode-vi PageUp send-keys -X page-up
bind -T copy-mode-vi PageDown send-keys -X page-down
bind -T copy-mode-vi M-PageUp send-keys -X halfpage-up
bind -T copy-mode-vi M-PageDown send-keys -X halfpage-down
bind -T copy-mode-vi S-PageUp send-keys -X page-up
bind -T copy-mode-vi S-PageDown send-keys -X page-down
bind -T copy-mode-vi WheelUpPane \
select-pane \; \
send-keys -X clear-selection \; \
send-keys -X -N 3 scroll-up
bind -T copy-mode-vi WheelDownPane \
select-pane \; \
send-keys -X clear-selection \; \
send-keys -X -N 3 scroll-down
# Set permanent window titles
bind , \
command-prompt -I '#W' "rename-window -- '%%'" \; \
set -g set-titles-string '#S.#I.#P.#F - #(whoami)@#H - #W' \; \
setw -g window-status-current-format '#W' \; \
setw -g window-status-format '#W' \; \
setw allow-rename off
# Settings
set -g base-index 1
set -s buffer-limit 5
set -s escape-time 0
set -g focus-events on
set -g history-limit 10000
set -s set-clipboard off
set -g status-keys emacs
setw -g aggressive-resize on
setw -g allow-rename on
setw -g automatic-rename off
setw -g monitor-activity on
setw -g pane-base-index 1
# Theme
set -g display-panes-time 2000
set -g display-time 2000
set -g message-style bg='#FFFF00',fg=black
set -g set-titles on
set -g set-titles-string '#S.#I.#P.#F #T'
set -g status-style bg=blue,fg=white
set -g status-interval 5
set -g status-position bottom
set -g status-right " | %H:%M "
setw -g clock-mode-style 24
setw -g window-status-activity-style bg=white,fg=blue
setw -g window-status-bell-style bg=red,fg=white
setw -g window-status-current-style bg=black,fg=white
setw -g window-status-current-format \
" #I #{pane_title}#{?window_flags, #{window_flags},} "
setw -g window-status-format \
" #I #{=-8:pane_title}#{?window_flags, #{window_flags},} "
# Locking
#set -g lock-after-time 900
#set -g lock-command vlock