-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf.dot
306 lines (224 loc) · 7.7 KB
/
tmux.conf.dot
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
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
# http://blog.yjl.im/2009/11/migrating-to-tmux-from-gnuscreen.html
# http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
# http://www.dayid.org/os/notes/tm.html
#
# Other sample tmux.conf files
#
# http://www.mindfuzz.net/?p=178
#
# -----------------------------------------------------------------------------
# Global settings
# Set prefix key to Ctrl-a
unbind-key C-b
set-option -g prefix C-a
# send the prefix to client inside window
bind-key C-a send-prefix
# toggle last window like screen
bind-key C-a last-window
# open a man page in new window
bind-key / command-prompt "split-window 'exec man %%'"
# scrollback buffer n lines
set -g history-limit 30000
# listen for activity on all windows
set -g bell-action any
# start window indexing at zero (default)
set -g base-index 1
# tell tmux to use 256 colour terminal
set-option -g default-terminal "screen-256color"
#SLOW, Add to verify if it increase vim integration in tmux.
set-option -s escape-time 10
# xterm-style function key sequences
setw -g xterm-keys on
# control automatic window renaming
setw -g automatic-rename off
# enable wm window titles
set -g set-titles on
# Key bindings
# reload settings
bind-key "~" source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# detach client
bind-key d detach
bind-key C-d detach
# choose a client to detach
bind-key D choose-client
# choose window/session
bind-key "'" choose-window
bind-key '"' choose-session
# display visible indicator of each pane
bind-key w display-panes
# navigate panes using jk, and ctrl+jk (no prefix)
bind-key -r j select-pane -t :.-
bind-key -r k select-pane -t :.+
bind-key -r C-j select-pane -t :.-
bind-key -r C-k select-pane -t :.+
# navigate windows using hl, and ctrl-hl (no prefix)
bind-key -r h select-window -t :-
bind-key -r l select-window -t :+
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# swap panes
bind-key -r J swap-pane -D
bind-key -r K swap-pane -U
# Ctrl-Left/Right cycles thru windows (no prefix)
bind-key -n "C-Left" select-window -t :-
bind-key -n "C-Right" select-window -t :+
# Ctrl-Up/Down cyles thru panes (no prefix)
bind-key -n "C-Up" select-pane -t :.-
bind-key -n "C-Down" select-pane -t :.+
# kill current pane/window
bind-key q confirm-before kill-pane
bind-key Q confirm-before kill-window
bind-key C-q confirm-before kill-pane
# copying and pasting
bind-key [ copy-mode
bind-key ] paste-buffer -s \015
# vi-style controls for copy mode
setw -g mode-keys vi
# enable mouse selection in copy mode
set -g mouse on
# list all paste buffers (default key is '#')
bind-key b list-buffers
# choose buffer to paste interactively (default key was '=')
bind-key p choose-buffer
# delete the most recently copied buffer of text (default key was '-')
bind-key x delete-buffer
# Screen-like key bindings
# new window
bind-key C-c new-window
bind-key c new-window
# next
bind-key -r Space next-window
bind-key -r "C-Space" next-window
# prev
bind-key BSpace previous-window
# title (default key in tmux is ',')
bind-key A command-prompt "rename-window %%"
# quit
bind-key \ confirm-before kill-server
# displays
bind-key * list-clients
# redisplay (default key in tmux is 'r')
bind-key : command-prompt
bind-key r refresh-client
bind-key L clear-history
# Split windows like vim
# use vim-like keys for windows splits
bind-key s split-window -v
bind-key v split-window -h
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# 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'
# alternatively, use better mnemonics for horizontal/vertical splits
bind-key - split-window -v
bind-key _ split-window -v
bind-key | split-window -h
# resize panes like vim
bind-key -r < resize-pane -L 3
bind-key -r > resize-pane -R 3
bind-key -r + resize-pane -U 1
bind-key -r = resize-pane -D 1
# Statusbar settings
# toggle statusbar
bind-key s set status
# use vi-style key bindings in the status line
set -g status-keys vi
# amount of time for which status line messages and other indicators
# are displayed. time is in milliseconds.
set -g display-time 2000
# default statusbar colors
set -g status-fg white
set -g status-bg default
set -g status-attr default
# default window title colors
setw -g window-status-fg white
setw -g window-status-bg default
setw -g window-status-attr dim
# active window title colors
setw -g window-status-current-fg cyan
setw -g window-status-current-bg default
setw -g window-status-current-attr underscore
# command/message line colors
set -g message-fg white
set -g message-bg black
set -g message-attr bright
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
set-window-option -g other-pane-height 25
set-window-option -g other-pane-width 80
bind-key a last-pane
bind-key q display-panes
bind-key c new-window
bind-key t next-window
bind-key T previous-window
bind-key [ copy-mode
bind-key ] paste-buffer
# Setup 'v' to begin selection as in Vim
#FIXME: not working in latest tmux
##bind-key -T vi-copy v begin-selection
##bind-key -T vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
##unbind -T vi-copy Enter
##bind-key -T vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
set-window-option -g display-panes-time 1500
# Status Bar
set-option -g status-interval 1
set-option -g status-left ''
set-option -g status-right '%l:%M%p'
set-window-option -g window-status-current-fg magenta
set-option -g status-fg default
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
#
set -g status on
set-option -g allow-rename off
# WARN: Assuming you have zsh
set-option -g default-shell /bin/zsh
# WTF: Not used to it yet
#bind-key j choose-window "join-pane -v -s "%%""
#bind-key s choose-window "join-pane -h -s "%%""
# -----------------------------------------------------------------------------
# vim: fen fdl=0 fdm=marker
# Synchronize panes
bind-key C-s setw synchronize-panes on
bind-key C-t setw synchronize-panes off
# Tmux plugin manager
# Plugin list
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'jimeh/tmux-themepack'
# Renumber window indexes
set-option -g renumber-windows on
# Choose theme
set -g @themepack 'powerline/block/blue'
# vim-tmux-navigator
set -g @plugin 'christoomey/vim-tmux-navigator'
# Enable automatic restore
set -g @continuum-restore 'on'
# Resurrect save/restore
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
# Initialize the Tmux plugin manager (Note: Should be the last line)
run '~/.tmux/plugins/tpm/tpm'