-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
379 lines (268 loc) · 17.3 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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# ================================================================================================================================
#
# TMUX
#
# Update: 2023.01.05
#
# ================================================================================================================================
# ================================================================================================================================
# GENERAL - Settings
# ================================================================================================================================
# --------------------------------------------------------------o----------------------------------------------------------------o
# Settings Terminal Color
# --------------------------------------------------------------o----------------------------------------------------------------o
set-option -g default-terminal "screen-256color"
set-option -g -a terminal-overrides ",xterm-256color:Tc"
# --------------------------------------------------------------o----------------------------------------------------------------o
# Settings Prefix
# --------------------------------------------------------------o----------------------------------------------------------------o
# -- 1 PREFIX --
unbind-key C-b
set-option -g prefix C-f
bind-key f send-prefix
# -- 2 PREFIX --
set-option -g prefix2 Home
# --------------------------------------------------------------o----------------------------------------------------------------o
# Settings
# --------------------------------------------------------------o----------------------------------------------------------------o
# -- Vim Mode --
set-option -g mode-keys vi
set-option -g status-keys vi
# -- Mouse Mode --
set-option -g mouse on
# -- Wait Time --
set-option -g escape-time 10
set-option -g -s repeat-time 600
# -- Focus --
set-option -g focus-events on
# -- Status Postion --
set-option -g status-justify "absolute-centre"
# -- History --
set-option -g history-limit 10000
set-option -g history-file $HOE/.tmux/tmuxhistory
# -- Display --
set-option -g display-panes-time 800
set-option -g display-time 1000
set-option -g status-interval 10
# -- Activity Notice --
set-option -g monitor-activity on
set-option -g visual-activity off
# -- Index Settings (Window) --
set-option -g base-index 1
# -- Index Settings (Pane) --
set-option -g pane-base-index 1
# -- Auto Rename Window --
setw -g automatic-rename off
setw -g allow-rename off
setw -g set-titles off
# -- Auto Index Number --
set-option -g renumber-windows on
# -- None Bell --
set-option -g bell-action none
# -- Clipboard --
set-option -g set-clipboard on
# -- Pane Settings --
setw -g pane-border-style 'fg=#2c323c bg=colour0'
setw -g pane-active-border-style 'fg=#2c323c bg=colour0'
setw -g pane-border-indicators off
setw -g pane-border-lines 'single'
# setw -g pane-border-style 'fg=colour0 bg=colour0'
# setw -g pane-active-border-style 'fg=colour4 bg=colour0'
# setw -g pane-border-format '#{?pane_active,#[reverse],}#{pane_current_path}#{?pane_active,#[bg=#282C34],}'
setw -g pane-border-status 'top'
set-hook -g pane-focus-in "set-option -Fw pane-border-status '#{?#{e|>:#{window_panes},1},top,off}'"
# -- Popup Settings --
setw -g popup-border-lines 'rounded'
setw -g popup-border-style 'fg=colour4'
# -- Lock Settings --
# set-option -g lock-after-time 8
# set-option -g lock-command
# ================================================================================================================================
# Keymapping - Settings
# ================================================================================================================================
# -- Reload Tmux Config --
bind-key r source-file ~/.tmux.conf \; display-message " - RELOADED DONE - "
# -- Vim Mode Copy And Paste --
bind-key v copy-mode \; send-keys -X
bind-key -T copy-mode-vi 'Escape' send -X cancel
bind-key -T copy-mode-vi 'v' send-keys -X rectangle-toggle \; send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
unbind p
bind-key p paste-buffer
bind-key -T copy-mode-vi C-d send-keys -X halfpage-down
bind-key -T copy-mode-vi C-u send-keys -X halfpage-up
# -- New Split Window --
bind-key Enter split-window -h
bind-key \\ split-window -v
# -- New Window --
bind-key N new-window
# -- Next Window --
bind-key BSpace next-window
# -- Toggle Pane Layout --
bind-key = select-layout even-vertical
bind-key | select-layout even-horizontal
# -- Pane Resize --
bind-key -r H resize-pane -L 2
bind-key -r J resize-pane -D 2
bind-key -r K resize-pane -U 2
bind-key -r L resize-pane -R 2
# -- Focus 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
# -- Swap Pane --
bind-key > swap-pane -D
bind-key < swap-pane -U
# -- Kill pane/window/session --
bind x confirm-before -p "Kill This Windows? (y/n)" "kill-window"
bind X confirm-before -p "Kill Other Windows? (y/n)" "kill-window -a"
bind Q confirm-before -p "Kill-Session #S? (y/n)" kill-session
# --------------------------------------------------------------o----------------------------------------------------------------o
# -- Vim-Tmux-Navigator --
#
# See: https://github.com/christoomey/vim-tmux-navigator
# --------------------------------------------------------------o----------------------------------------------------------------o
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# -- Some extra key bindings to select higher numbered windows --
# bind F1 selectw -t:10
# bind F2 selectw -t:11
# bind F3 selectw -t:12
# bind F4 selectw -t:13
# bind F5 selectw -t:14
# bind F6 selectw -t:15
# bind F7 selectw -t:16
# bind F8 selectw -t:17
# bind F9 selectw -t:18
# bind F10 selectw -t:19
# bind F11 selectw -t:20
# bind F12 selectw -t:21
# -- Change Current Pane To Next Window --
bind-key u command-prompt -p "Join Pane From:" "join-pane -s ':%%'"
bind-key o command-prompt -p "Send Pane To:" "join-pane -t ':%%'"
# -- Move Pane To New Window --
# bind-key m break-pane
# bind-key ! join-pane -h :1
# bind-key @ join-pane -h :2
# bind-key '#' join-pane -h :3
# bind-key '$' join-pane -h :4
# bind-key '%' join-pane -h :5
# bind-key '^' join-pane -h :6
# bind-key '&' join-pane -h :7
# bind-key '*' join-pane -h :8
# bind-key '(' join-pane -h :9
# bind-key ')' join-pane -h :10
# --------------------------------------------------------------o----------------------------------------------------------------o
# Exit - Settings
# --------------------------------------------------------------o----------------------------------------------------------------o
# -- Disable Exit Tmux --
set-option -g remain-on-exit on
# -- Reset Remain-Exit Status --
bind-key R respawn-window
# -- If The Last Window Disable Exit Tmux --
set-hook -g pane-died "if -F '#{&&:#{==:#{session_windows},1},#{==:#{window_panes},1}}' 'respawn-pane' 'kill-pane'"
# ================================================================================================================================
# Plugings - Settings
# ================================================================================================================================
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM Plugings
# --------------------------------------------------------------o----------------------------------------------------------------o
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins/'
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM Lists
# --------------------------------------------------------------o----------------------------------------------------------------o
set-option -g @plugin 'tmux-plugins/tpm'
set-option -g @plugin 'tmux-plugins/tmux-sensible'
set-option -g @plugin 'https://hub.nuaa.cf/tmux-plugins/tmux-prefix-highlight'
set-option -g @plugin 'https://hub.nuaa.cf/christoomey/vim-tmux-navigator'
set-option -g @plugin 'https://hub.nuaa.cf/tmux-plugins/tmux-yank'
set-option -g @plugin 'https://hub.nuaa.cf/brennanfee/tmux-paste'
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM Install
# --------------------------------------------------------------o----------------------------------------------------------------o
run -b '~/.tmux/plugins/tpm/tpm'
# --------------------------------------------------------------o----------------------------------------------------------------o
# Reload Theme
# --------------------------------------------------------------o----------------------------------------------------------------o
# run -b '$HOME/.config/tmux/onedark.tmux'
# --------------------------------------------------------------o----------------------------------------------------------------o
# Custom Theme
# --------------------------------------------------------------o----------------------------------------------------------------o
set-option -g status "on"
# set-option -g status-justify "absolute-centre"
set-option -g status-justify "centre"
set-option -g status-left-style "none"
set-option -g status-right-style "none"
# set-option -g pane-border-style "fg=#404455"
# set-option -g pane-active-border-style "fg=#6cb6eb"
set-window-option -g window-status-style fg=colour4,bg=default
set-window-option -g window-status-current-style fg=colour2,bg=default
set-window-option -g clock-mode-colour blue
set-option -g message-style "fg=#c5cdd9,bg=#404455"
set-option -g message-command-style "fg=#c5cdd9,bg=#404455"
set-option -g status-style "none,bg=#2c323c"
set-option -g status-left-length "100"
set-option -g status-right-length "100"
set-option -g window-status-style "none,fg=#c5cdd9,bg=#333644"
set-option -g window-status-activity-style "none,fg=#61afef,bg=#333644"
set-option -g window-status-separator ""
set-option -g window-status-format "#[fg=#2C323C,bg=#404455,nobold,nounderscore,noitalics]#[fg=#959ca9,bg=#404455] #I #[fg=#404455,bg=#2C323C,nobold,nounderscore,noitalics]"
set-option -g window-status-current-format "#[fg=#2C323C,bg=#586378,nobold,nounderscore,noitalics]#[fg=#ffffff,bg=#586378] #I #[fg=#586378,bg=#2C323C,nobold,nounderscore,noitalics]"
set-option -g status-left "#[fg=#2b2d37,bg=#80a0c1] #S #[fg=#80a0c1,bg=#404455,nobold,nounderscore,noitalics]#[fg=#c5cdd9,bg=#404455] %R #[fg=#404455,bg=#2c323c,nobold,nounderscore,noitalics]#{prefix_highlight}#[fg=#2c323c,bg=#2c323c,nobold,nounderscore,noitalics]#[default]"
set-option -g status-right "#[fg=#404455,bg=#2c323c,nobold,nounderscore,noitalics]#[fg=#c5cdd9,bg=#404455] %Y-%m-%d #[fg=#80a0c1,bg=#404455,nobold,nounderscore,noitalics]#[fg=#2b2d37,bg=#80a0c1] #H "
set-option -g mode-style "fg=#282C34,bg=#61afef"
# setw -g window-status-format "#[fg=#333644,bg=#404455,nobold,nounderscore,noitalics]#[fg=#c5cdd9,bg=#404455] #I #{default} #{=4:window_name} #{default} #[fg=#404455,bg=#2C323C,nobold,nounderscore,noitalics]"
# setw -g window-status-current-format "#[fg=#333644,bg=#C678DD,nobold,nounderscore,noitalics]#[fg=#282C34,bg=#C678DD] #I #{default} #{=4:window_name} #{default} · #[fg=#C678DD,bg=#333644,nobold,nounderscore,noitalics]"
# SET INACTIVE/ACTIVE WINDOW STYLES
set-option -g window-style 'fg=colour247,bg=#30353E'
set-option -g window-active-style 'fg=colour250,bg=black'
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM - PLUGINS - Onedark
# --------------------------------------------------------------o----------------------------------------------------------------o
# set-option -g @onedark_widgets "#(date +%H:%M)"
# set-option -g @onedark_time_format ""
# set-option -g @onedark_date_format "%Y-%m-%d"
# set-option -g @onedark_date_first true
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM - PLUGINS - Highlight
# --------------------------------------------------------------o----------------------------------------------------------------o
set-option -g @prefix_highlight_prefix_prompt ' Wait '
set-option -g @prefix_highlight_copy_prompt ' Copy '
set-option -g @prefix_highlight_show_copy_mode 'on'
set-option -g @prefix_highlight_copy_mode_attr 'fg=black,bg=#C678DD' # default is 'fg=default,bg=yellow'
set-option -g @prefix_highlight_show_sync_mode 'on'
set-option -g @prefix_highlight_sync_mode_attr 'fg=black,bg=#98C379' # default is 'fg=default,bg=yellow'
set-option -g @prefix_highlight_fg 'black ' # default is 'colour231'
set-option -g @prefix_highlight_bg 'red' # default is 'colour04'
set-option -g @prefix_highlight_output_prefix ''
set-option -g @prefix_highlight_output_suffix ''
set-option -g @prefix_highlight_empty_prompt ' ' # default is '' (empty char)
set-option -g @prefix_highlight_empty_attr 'fg=#2C323C,bg=#2C323C' # default is 'fg=default,bg=default'
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM - PLUGINS - Yank
# --------------------------------------------------------------o----------------------------------------------------------------o
set-option -g @yank_selection 'primary' # 'primary' or 'secondary' or 'clipboard'
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM - PLUGINS - Paste
# --------------------------------------------------------------o----------------------------------------------------------------o
set-option -g @paste_selection 'primary' # 'primary' or 'secondary' or 'clipboard'
# --------------------------------------------------------------o----------------------------------------------------------------o
# TPM - PLUGINS - Continuum
# --------------------------------------------------------------o----------------------------------------------------------------o
# set-option -g @continuum-boot 'on'
# set-option -g @continuum-restore 'on'
# set-option -g @continuum-save-interval '15'
# set-option -g status-right 'Continuum status: #{continuum_status}'
# vim:ft=tmux