-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux.conf
283 lines (237 loc) · 5.92 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
# Make it use C-a
unbind C-b
set -g prefix C-a
bind a send-prefix # these last to allow C-a to be passed through
bind C-a send-prefix
# Unbind existing tmux key bindings, except a few that are commented out.
unbind C-o
unbind C-z
unbind Space
unbind !
unbind '"'
unbind '#'
unbind %
unbind &
unbind "'"
unbind ,
unbind -
unbind .
unbind :
unbind =
unbind ?
unbind D
unbind '['
unbind ']'
unbind c
unbind d
unbind f
unbind i
unbind l
unbind n
unbind o
unbind p
unbind q
unbind r
unbind s
unbind t
unbind w
unbind x
unbind '{'
unbind '}'
unbind '~'
unbind PPage
unbind Up
unbind Down
unbind Left
unbind Right
#unbind 0
#unbind 1
#unbind 2
#unbind 3
#unbind 4
#unbind 5
#unbind 6
#unbind 7
#unbind 8
#unbind 9
unbind M-1
unbind M-2
unbind M-3
unbind M-4
unbind M-5
unbind M-n
unbind M-o
unbind M-p
unbind M-Up
unbind M-Down
unbind M-Left
unbind M-Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
### KEY BINDINGS
# first unbind, then bind: this allows on-the-fly config reloading (with C-r)
# quick tip: the '-r' flag means they can be pressed repeatedly
# note: I only added the shortcuts I use, please "man tmux" to go beyond
# basic window operations
unbind c
bind c new-window -c "$HOME" # always start at home dir, zsh plugin changes then to the last used dir
unbind & # purposefully diffcult combination, better the shell's "C-d", or kill-pane
bind & confirm-before kill-window
unbind x # close pane (if last also the window)
bind x confirm-before kill-pane
# window cycling "p" or Left for previous window
unbind p
bind -r p previous-window
unbind Left
bind -r Left previous-window
# "n" and Right for next window
unbind n
bind -r n next-window
unbind Right
bind -r Right next-window
# find a window by name
unbind f
bind f command-prompt "find-window '%%'"
# rename a window (gnuscreen default shortcut)
unbind A
bind A command-prompt "rename-window %%"
# Ctrl-s for last active window
unbind C-s
bind -r C-s last-window
# window picker
unbind w
bind w choose-window
# add split side-by-side
unbind |
bind -r | split-window -h
# add split top-bottom
unbind _
bind -r _ split-window -v
unbind =
bind -r = select-layout even-horizontal
# swap panes
unbind {
bind -r { swap-pane -U
unbind }
bind -r } swap-pane -D
# number panes visibly
unbind q
bind q display-panes
# cycle through pane layouts
unbind Space
bind -r Space next-layout
# change to window using F1-F12 without prefix (-n)
unbind F1
bind-key -n F1 select-window -t :1
unbind F2
bind-key -n F2 select-window -t :2
unbind F3
bind-key -n F3 select-window -t :3
unbind F4
bind-key -n F4 select-window -t :4
# change pane focus (like vi cursor movement)
unbind k
bind -r k select-pane -U
unbind j
bind -r j select-pane -D
unbind h
bind -r h select-pane -L
unbind l
bind -r l select-pane -R
# resize pane
unbind '('
bind -r '(' resize-pane -L 4
unbind ')'
bind -r ')' resize-pane -R 4
unbind +
bind -r + resize-pane -U 2
unbind -
bind -r - resize-pane -D 2
# command line
unbind :
bind : command-prompt
# display key bindings
unbind ?
bind ? list-keys
# copy and scroll mode (see "man tmux"), and paste
unbind [
bind [ copy-mode
unbind ]
bind -r ] paste-buffer # sadly '-r' doesnt work here, hopefully one day it does
unbind PPage
bind PPage copy-mode -u # to copymode and one page up (pgup/dn passed on)
# additional keys to use in copy (scroll) mode
bind -T copy-mode-emacs Enter send-keys -X copy-selection
bind -T copy-mode-emacs Space send-keys -X begin-selection
# apply the config file again...
unbind r
bind r source-file ~/.tmux.conf
# paste from clipboard with Ctrl-y
bind-key -n C-y run "xclip -o | tmux load-buffer - ; tmux paste-buffer"
# page up and down
# --> this has to be done for the shell, vi aparently works well.
# TODO:
# * keybindings for detaching/attaching
# * for session/client/buffer management
# * for buffer filling and pasting
# * mouse scroll fix
# * mouse click focus
# * alt-tab style feature request
# * select+move splitters (need splitter highlighting)
# * quake style "toggle terminal from above", bound to "~"
# its not logic to have the most left 'tab' on the very right of the key strip
set -g base-index 1
# should fix scrolling issues (with shift pgup/dn)
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -ga terminal-overrides ',*256col*:Tc'
# some general config options
setw -g xterm-keys on
set -g default-terminal "st-256color"
#set -g default-terminal "xterm"
set -g history-limit 10000
set -g repeat-time 800
set -g status on
set -g status-keys vi
set -g bell-action any
set -g visual-bell off # switching this on leads to a disappearing cursor in vim sometimes
setw -g monitor-activity on # monitor activity of all windows
set -g visual-activity off # no flashy messages in my status line please! (watch the window attrs '#-*!+' instead)
setw -g mode-keys vi
set-window-option -g aggressive-resize on # limit window size to smallest client actually viewing the window (instead of viewing the whole session)
# window title
set -g set-titles on
setw -g automatic-rename on
# status bar
set -g status-justify centre
set -g status-interval 5
set -g status-left-length 30
set -g status-left ''
set -g status-right '#[fg=blue,bold]#H#[default] » #[fg=magenta]%R#[default]'
set -g status-right-length 45
# colors
set -g message-bg default
set -g message-fg green
set -g status-bg default
set -g status-fg green
setw -g window-status-bg default
setw -g window-status-fg green
#setw -g window-status-alert-attr none
#setw -g window-status-alert-bg default
#setw -g window-status-alert-fg green
setw -g window-status-current-bg red
setw -g window-status-current-fg white
set -g @colors-solarized 'light'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'seebi/tmux-colors-solarized'
#
# Other examples:
# github_username/plugin_name \
# [email protected]/user/plugin \
# [email protected]/user/plugin \
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell ~/.tmux/plugins/tpm/tpm