-
-
Notifications
You must be signed in to change notification settings - Fork 98
/
.tmux.conf
360 lines (307 loc) · 11.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# vim:fdm=marker expandtab fdc=3 ft=tmux ts=2 sw=2 sts=2:
#
# Hierarchy:
# Server
# ㄴSession
# ㄴWindow
# ㄴPane
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'seebi/tmux-colors-solarized'
set -g @plugin 'babarot/tmux-git-prompt'
set -g mouse on
bind-key -T edit-mode-vi WheelUpPane send-keys -X scroll-up
bind-key -T edit-mode-vi WheelDownPane send-keys -X scroll-down
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
set-option -s escape-time 0
set-option -g prefix C-t
bind-key C-t send-prefix
unbind-key C-b
# Keep the window's name fixed
# cf. http://blog.yagni.jp/archives/498 (in japanese)
# cf. http://stackoverflow.com/questions/6041178/keep-the-windows-name-fixed-in-tmux
set-option -g allow-rename off
# System window by supported OS
set-option -g set-titles on
set-option -g set-titles-string "[tmux] #T @ #H"
# Enable clipboard
#set-option -g default-command \
#'which reattach-to-user-namespace >/dev/null 2>&1 && \
#reattach-to-user-namespace -l bash || bash'
# Display time
set-option -g display-time 3500
# Operations
## Clients
# Switch clients
bind-key N switch-client -n
bind-key P switch-client -p
## Window
# Start window index 1 origin
set-option -g base-index 1
# # Split window
# bind-key | split-window -h
#
# # Vertical split window
# bind-key - split-window -v
# prefix |
bind-key | split-window -h -c "#{pane_current_path}"
# prefix -
bind-key - split-window -c "#{pane_current_path}"
# Change active window
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
## Pane
# Start pane index 1 origin
set-window-option -g pane-base-index 1
# Resize pane
bind-key -r H resize-pane -L 5
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r L resize-pane -R 5
# Change active pane
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Rotate active pane
# bind-key -n C-o run "tmux select-pane -l || tmux select-pane -t :.+"
# Break or kill pane
bind-key b break-pane
bind-key q kill-pane
bind-key C-q kill-session
#bind-key C-k display-panes\; kill-pane\;
#bind-key C-k display-panes\; confirm-before kill-pane\;
bind-key C-x run "tmux kill-pane || tmux kill-window"
bind-key C-t run "tmux last-pane || tmux last-window || tmux new-window"
# Display pane
bind-key i display-panes
# Key-bindings
# Reload config file
bind-key r source-file ~/.tmux.conf\; display-message "[tmux] ~/.tmux.conf reloaded!"
bind-key C-r source-file ~/.tmux.conf\; display-message "[tmux] ~/.tmux.conf reloaded!"
# Look up in a web dictionary
bind-key g command-prompt -p "Google Translate en->ja:" "split-window 'source ~/.zshrc >/dev/null; gte %% | less'"
bind-key G command-prompt -p "Google Translate ja->en:" "split-window 'source ~/.zshrc >/dev/null; gtj %% | less'"
# Look up in a man-page
bind-key m command-prompt -p "Man:" "split-window 'man %%'"
# Appearance
# Status-position to move the status line to the top of the screen
# available on tmux -V 1.7
# cf. http://sourceforge.net/projects/tmux/files/tmux/tmux-1.7/
set-option -g status-position top
set-option -g default-terminal "screen-256color"
# set-option -g pane-active-border-bg colour235
setw -g window-status-activity-style bg="colour235"
## Customize statusline
set-option -g status on
# Length left
set-option -g status-left-length 90
set-option -g status-right-length 90
# set-option -g status-left 'tmux:[#P] #[fg=colour33]#(kube-context 2>&1)#[default] #[fg=colour1]#(gcp-context 2>&1)#[default]'
set-option -g status-left 'tmux:[#P] #[fg=blue](#(kube-context 2>&1))#[default] #[fg=red](#(gcp-context 2>&1))#[default]'
set-option -g status-right '#[fg=white]#(wifi)#[default] #(battery --tmux) [%Y-%m-%d(%a) %H:%M]'
set-window-option -g pane-border-status top
# set-window-option -g pane-border-format ' #(~/bin/tmux-git-prompt #{pane_current_path}) '
# Reload statusbar
set-option -g status-interval 1
# Centerize
set-option -g status-justify centre
# Enable visual notification
set-window-option -g monitor-activity on
# Enable visual notification
set-option -g visual-activity on
# Enable statusbar top
set-option -g status-position top
# ## Colorscheme: Solarized
#
# # Default statusbar colors
# set-option -g status-bg colour235 #base02
# set-option -g status-fg colour136 #yellow
# set-option -g status-attr default
#
# # Default window title colors
# set-window-option -g window-status-fg colour244 #base0
# set-window-option -g window-status-bg default
# set-window-option -g window-status-attr dim
#
# # Active window title colors
# set-window-option -g window-status-current-fg colour166 #orange
# set-window-option -g window-status-current-bg default
# set-window-option -g window-status-current-attr bright
#
# # Pane border
# set-option -g pane-border-fg colour235 #base02
# set-option -g pane-active-border-fg colour240 #base01
#
# # Message text
# set-option -g message-bg colour235 #base02
# set-option -g message-fg colour166 #orange
#
# # Pane number display
# set-option -g display-panes-active-colour colour33 #blue
# set-option -g display-panes-colour colour166 #orange
#
# # Clock
# set-window-option -g clock-mode-colour colour64 #green
# Copy-mode
set-window-option -g mode-keys vi
bind-key v copy-mode \; display "Copy mode!"
bind-key C-v copy-mode \; display "Copy mode!"
bind-key C-t copy-mode \; display "Copy mode!"
# bind-key p paste-buffer
# # Make pbcopy/pbpaste and Vim's * register work.
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# bind-key -t vi-copy v begin-selection
# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# unbind-key -t vi-copy Enter
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
unbind-key -T copy-mode-vi Space
bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi Enter
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# unbind-key -T copy-mode-vi C-v ;bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
# unbind-key -T copy-mode-vi [ ;bind-key -T copy-mode-vi [ send-keys -X begin-selection
# unbind-key -T copy-mode-vi ] ;bind-key -T copy-mode-vi ] send-keys -X copy-selection
# Back to indentation ^
# Bottom of history G
# Clear selection Escape
# Copy selection Enter
# Cursor down j
# Cursor left h
# Cursor right l
# Cursor to bottom line L
# Cursor to middle line M
# Cursor to top line H
# Cursor up k
# Delete entire line d
# Delete/Copy to end of line D
# End of line $
# Go to line :
# Half page down C-d
# Half page up C-u
# Jump forward f
# Jump to forward t
# Jump backward F
# Jump to backward T
# Jump again ;
# Jump again in reverse ,
# Next page C-f
# Next space W
# Next space, end of word E
# Next word w
# Next word end e
# Other end of selection o
# Paste buffer p
# Previous page C-b
# Previous word b
# Previous space B
# Quit mode q
# Rectangle toggle v
# Scroll down C-Down or C-e
# Scroll up C-Up or C-y
# Search again n
# Search again in reverse N
# Search backward ?
# Search forward /
# Start of line 0
# Start selection Space
# Top of history g
# bind-key -t vi-copy Escape clear-selection
# bind-key -t vi-copy C-c cancel
# bind-key -t vi-copy C-v rectangle-toggle
# bind-key -t vi-copy C-a start-of-line
# bind-key -t vi-copy C-e end-of-line
# bind-key -t vi-copy w next-word
# bind-key -t vi-copy e next-word-end
# bind-key -t vi-copy b previous-word
# bind-key -t vi-copy g top-line
# bind-key -t vi-copy G bottom-line
# #bind-key -t vi-copy Space next-space
# bind-key -t vi-copy / search-forward
# bind-key -t vi-copy ? search-backward
# bind-key -t vi-copy C-n page-up
# bind-key -t vi-copy C-f page-down
# bind-key -t vi-copy C-u scroll-up
# bind-key -t vi-copy C-d scroll-down
#bind-key -t vi-copy Y copy-line
# unbind-key Space
#bind-key -t vi-copy Space begin-selection \; end-of-line
#bind-key -t vi-copy V copy-end-of-line
# bind-key -t vi-copy V select-line
#bind-key -t vi-copy V copy-end-of-line
#bind-key -t vi-copy C-b page-up
#bind-key -t vi-copy C-c cancel
#bind-key -t vi-copy C-e scroll-down
#bind-key -t vi-copy C-f page-down
#bind-key -t vi-copy C-h cursor-left
#bind-key -t vi-copy Enter copy-selection
#bind-key -t vi-copy C-y scroll-up
#bind-key -t vi-copy Escape clear-selection
#bind-key -t vi-copy Space begin-selection
#bind-key -t vi-copy $ end-of-line
#bind-key -t vi-copy , jump-reverse
#bind-key -t vi-copy / search-forward
#bind-key -t vi-copy 0 start-of-line
#bind-key -t vi-copy 1 start-number-prefix
#bind-key -t vi-copy 2 start-number-prefix
#bind-key -t vi-copy 3 start-number-prefix
#bind-key -t vi-copy 4 start-number-prefix
#bind-key -t vi-copy 5 start-number-prefix
#bind-key -t vi-copy 6 start-number-prefix
#bind-key -t vi-copy 7 start-number-prefix
#bind-key -t vi-copy 8 start-number-prefix
#bind-key -t vi-copy 9 start-number-prefix
#bind-key -t vi-copy : goto-line
#bind-key -t vi-copy \; jump-again
#bind-key -t vi-copy ? search-backward
#bind-key -t vi-copy B previous-space
#bind-key -t vi-copy D copy-end-of-line
#bind-key -t vi-copy E next-space-end
#bind-key -t vi-copy F jump-backward
#bind-key -t vi-copy G history-bottom
#bind-key -t vi-copy H top-line
#bind-key -t vi-copy J scroll-down
#bind-key -t vi-copy K scroll-up
#bind-key -t vi-copy L bottom-line
#bind-key -t vi-copy M middle-line
#bind-key -t vi-copy N search-reverse
#bind-key -t vi-copy T jump-to-backward
#bind-key -t vi-copy W next-space
#bind-key -t vi-copy ^ back-to-indentation
#bind-key -t vi-copy b previous-word
#bind-key -t vi-copy e next-word-end
#bind-key -t vi-copy f jump-forward
#bind-key -t vi-copy g history-top
#bind-key -t vi-copy h cursor-left
#bind-key -t vi-copy j cursor-down
#bind-key -t vi-copy k cursor-up
#bind-key -t vi-copy l cursor-right
#bind-key -t vi-copy n search-again
#bind-key -t vi-copy q cancel
#bind-key -t vi-copy t jump-to-forward
#bind-key -t vi-copy v rectangle-toggle
#bind-key -t vi-copy w next-word
#bind-key -t vi-copy BSpace cursor-left
#bind-key -t vi-copy NPage page-down
#bind-key -t vi-copy PPage page-up
#bind-key -t vi-copy Up cursor-up
#bind-key -t vi-copy Down cursor-down
#bind-key -t vi-copy Left cursor-left
#bind-key -t vi-copy Right cursor-right
#bind-key -t vi-copy C-Up scroll-up
#bind-key -t vi-copy C-Down scroll-down
# Misc
#set-option -g pane-active-border-fg white
#set-option -g pane-active-border-bg yellow
#bind-key C-f command-prompt "switch-client -t %%"
#bind-key C-y choose-buffer
#bind-key C-g choose-session
#bind-key C-g choose-window
#bind-key s command-prompt "select-window -t %%"
run -b '~/.tmux/plugins/tpm/tpm'