-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf-3.2
332 lines (258 loc) · 8.58 KB
/
tmux.conf-3.2
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
# ~/.tmux.conf
#
# You will need the following to use this ~/.tmux.conf file on OS X
#
# brew install reattach-to-user-namespace
#
# 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
# /opt/homebrew/opt/tmux/share/tmux/example_tmux.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
# default command (used for new windows)
# https://robots.thoughtbot.com/how-to-copy-and-paste-with-tmux-on-mac-os-x
# https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
##set-option -g default-command "tmux rename-window bash; reattach-to-user-namespace -l /usr/local/bin/bash"
##set-option -g default-command "tmux rename-window bash; reattach-to-user-namespace -l /opt/homebrew/bin/bash"
# default shell
##set -g default-shell /usr/local/bin/bash
##set -g default-shell /opt/homebrew/bin/bash
# scrollback buffer n lines
set -g history-limit 5000
# change the key binding repeat-time (default is 500)
set -g repeat-time 1000
# change the display time for on-screen indicators (default is empty)
set -g display-time 500
# listen for activity on all windows
set -g bell-action any
#set -g bell-action none
# quiet mode (enables/disables display of various informational messages)
#set -g quiet on
# start window indexing at zero (default)
set -g base-index 0
# tell tmux to use 256 colour terminal
set -g default-terminal "screen-256color"
#set -g default-terminal "tmux-256color"
# xterm-style function key sequences
setw -g xterm-keys on
# dynamically update iTerm tab and window titles
set -g set-titles on
# but don't change tmux's own window titles
setw -g automatic-rename off
# window title string (uses statusbar variables)
# Codes -- see FORMATS section of `man tmux`
# #T = standard window title (last command)
# #h = short hostname
# #S = session name
# #W = tmux window name
#set -g set-titles-string "tmux.#I.#W"
#set -g set-titles-string "#{session_name} - #{host}"
#set -g set-titles-string "#S / #W"
#set -g set-titles-string "#T : #h > #S > #W"
# don't close windows. just deactivate them. use respawn-window to reactivate.
#setw -g remain-on-exit on
# enable mouse support
set -g mouse on
# vi-style controls for copy mode
setw -g mode-keys vi
# }}}
# Key bindings {{{
# reload settings
bind-key R source-file ~/.tmux.conf
# detach client
bind-key d detach
bind-key C-d detach
# choose a client to detach
bind-key D choose-client
# switch to prev/next client
bind-key -r ( switch-client -p
bind-key -r ) switch-client -n
bind-key n switch-client -n
bind-key p switch-client -p
# choose window/session
bind-key "'" choose-window
bind-key '"' choose-session
# display visible indicator of each pane
bind-key w display-panes
# Cycle to next pane
bind-key -r Tab select-pane -t :.+
# Navigate panes using jkhl (no prefix)
bind-key j select-pane -D
bind-key k select-pane -U
bind-key h select-pane -L
bind-key l select-pane -R
bind-key C-j select-pane -D
bind-key C-k select-pane -U
bind-key C-h select-pane -L
bind-key C-l select-pane -R
# swap panes
bind-key -r J swap-pane -D
bind-key -r K swap-pane -U
##bind-key -r { swap-pane -U
##bind-key -r } swap-pane -D
# 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
#bind-key x kill-pane
#bind-key X kill-window
# window layouts (emacs-like)
#bind-key 1 break-pane
#bind-key 2 select-layout even-vertical
#bind-key 3 select-layout even-horizontal
#bind-key o select-pane -U
# specific window layouts
#bind o select-layout "active-only"
#bind O select-layout "main-vertical"
# cycle to the next pane layout (default key is 'Space')
bind -r y next-layout
# open a man page in new window
bind-key / command-prompt -p "man page for:" "split-window 'exec man %%'"
# quick view of processes
##bind-key "~" split-window "exec htop"
# do these commands need a key binding?
#bind-key XYZ list-sessions
#bind-key XYZ list-windows
#bind-key XYZ list-panes
#bind-key XYZ show-window-options -g
#bind-key XYZ show-messages -g
#bind-key XYZ show-environment -g
# lists all key bindings (default key is '?')
bind-key ? list-keys
# list the syntax of all tmux commands
bind-key m list-commands
# show the global options
bind-key , show-options -g
# show the global window options
bind-key . show-window-options -g
# copying and pasting
bind-key [ copy-mode
bind-key ] paste-buffer
# list all paste buffers (default key is '#')
bind-key b list-buffers
# choose buffer to paste interactively (default key is '=')
bind-key v choose-buffer
# delete the most recently copied buffer of text (default key is '-')
bind-key x delete-buffer
# Setup 'v' to begin selection as in Vim
#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"
# }}}
# Screen-like key bindings {{{
# new window
bind-key C-c new-window
bind-key c new-window
# next window (default key in tmux is 'n')
bind-key Space next-window
bind-key -r "C-Space" next-window
# prev window
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 clients attached to the server
bind-key * list-clients
# redisplay (default key in tmux is 'r')
#bind-key C-l refresh-client
#bind-key l refresh-client
bind-key r refresh-client
# }}}
# Split windows like vim {{{
# vim's definition of a horizontal/vertical split is reversed from tmux's
#bind-key v split-window -h
#bind-key s split-window -v
# alternatively, use better mnemonics for horizontal/vertical splits
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
bind-key _ split-window -v -c "#{pane_current_path}"
# resize panes like vim
bind-key -r < resize-pane -L 3
bind-key -r > resize-pane -R 3
bind-key -r + resize-pane -U 3
bind-key -r = resize-pane -D 3
# }}}
# 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
# refresh interval for status bar
set -g status-interval 30
# default statusbar colors
set -g status-style fg=white,bg=default
# default window title colors
setw -g window-status-style fg=white,bg=default,dim
# active window title colors
setw -g window-status-current-style fg=cyan,bg=default,underscore
# command/message line colors
set -g message-style fg=white,bg=black,bright
# }}}
# -----------------------------------------------------------------------------
## From /opt/homebrew/opt/tmux/share/tmux/example_tmux.conf
## TODO: Take lines from here and move them above.
##
# Some tweaks to the status line
## set -g status-right "%H:%M"
## set -g window-status-current-style "underscore"
##
# If running inside tmux ($TMUX is set), then change the status line to red
%if #{TMUX}
set -g status-bg red
%endif
# Enable RGB colour if running in xterm(1)
set-option -sa terminal-overrides ",xterm*:Tc"
## # Change the default $TERM to tmux-256color
## set -g default-terminal "tmux-256color"
## # No bells at all
## set -g bell-action none
##
## # Keep windows around after they exit
## set -g remain-on-exit on
##
## # Change the prefix key to C-a
## set -g prefix C-a
## unbind C-b
## bind C-a send-prefix
##
## # Turn the mouse on, but without copy mode dragging
## set -g mouse on
## unbind -n MouseDrag1Pane
## unbind -Tcopy-mode MouseDrag1Pane
##
##
## # A key to toggle between smallest and largest sizes if a window is visible in
## # multiple places
## bind F set -w window-size
##
## # Keys to toggle monitoring activity in a window and the synchronize-panes option
## bind m set monitor-activity
## bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}'