-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
217 lines (161 loc) · 7.08 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
# -- general -------------------------------------------------------------------
set -g default-terminal 'screen-256color'
setw -g xterm-keys on
setw -g status-keys emacs
setw -g mode-keys emacs
if 'test -n "${TMUX_SHELL}"' 'set -g default-shell "${TMUX_SHELL}"'
if 'test -n "${TMUX_TERM}"' 'set -g default-terminal "${TMUX_TERM}"'
# fastest command sequences
set -sg escape-time 100
# increase repeat timeout
# set -sg repeat-time 600
# GNU-Screen compatible prefix
set -g prefix C-a
unbind C-b
bind C-a send-prefix
if 'test -n "${TMUX_PREFIX}"' 'set -g prefix ${TMUX_PREFIX} ; bind ${TMUX_PREFIX} send-prefix'
# boost history
set -g history-limit 5000
# edit configuration
bind e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# see https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
if 'which -s reattach-to-user-namespace' 'set -g default-command "exec initializing... 2> /dev/null & reattach-to-user-namespace $SHELL -l"'
# -- display -------------------------------------------------------------------
# start windows numbering at 1
set -g base-index 1
# make pane numbering consistent with windows
setw -g pane-base-index 1
# rename window to reflect current program
setw -g automatic-rename on
# renumber windows when a window is closed
set -g renumber-windows on
# set terminal title
set -g set-titles on
set -g set-titles-string '#h ❐ #S ● #I #W'
set-option -g allow-rename off
# slightly longer pane indicators display time
set -g display-panes-time 800
# slightly longer status messages display time
set -g display-time 1000
# redraw status line every 10 seconds
set -g status-interval 10
# 24 hour clock
setw -g clock-mode-style 24
# clear both screen and history
bind -n C-l send-keys C-l \; run 'tmux clear-history'
# activity
set -g monitor-activity on
set -g visual-activity off
# -- navigation ----------------------------------------------------------------
# create new window
bind c new-window -c "#{pane_current_path}"
# create new session
bind C-n new-session
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# move to last active session
bind S switch-client -l
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
bind C-p command-prompt -p 'swap pane with: ' 'swap-pane -t %%'
bind M-p command-prompt -p 'move pane to: ' 'move-pane -t %%'
bind 0 select-pane -t 0
bind 1 select-pane -t 1
bind 2 select-pane -t 2
bind 3 select-pane -t 3
bind 4 select-pane -t 4
bind 5 select-pane -t 5
bind 6 select-pane -t 6
bind 7 select-pane -t 7
bind 8 select-pane -t 8
bind 9 select-pane -t 9
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# window navigation
bind Space last-window # move to last active window
bind '{' swap-window -t -1 # swap current window with the previous one
bind '}' swap-window -t +1 # swap current window with the next one
bind C-w command-prompt -p 'swap window with: ' 'swap-window -t %%'
bind M-w command-prompt -p 'move window to: ' 'move-window -t %%'
# -- copy mode -----------------------------------------------------------------
bind Enter copy-mode # enter copy mode
bind b list-buffers # list paster buffers
bind C-b choose-buffer # choose which buffer to paste from
bind C-y paste-buffer # paste from the top pate buffer
## CLIPBOARD selection integration
# copy to Mac OSX pasteboard
if 'which -s reattach-to-user-namespace' 'bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# paste from Mac OSX pasteboard
if 'which -s reattach-to-user-namespace' 'bind C-v run "tmux set-buffer -- \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer"'
# Copy tmux paste buffer to CLIPBOARD
if 'which -s xsel' 'bind C-c run "tmux show-buffer | xsel -i -b"'
# Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
if 'which -s xsel' 'bind C-v run "tmux set-buffer -- \"$(xsel -o -b)\"; tmux paste-buffer"'
# -- user defined --------------------------------------------------------------
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
# -- window split --------------------------------------------------------------
# Getting interesting now, we use the vertical and horizontal
# symbols to split the screen
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# -- status --------------------------------------------------------------------
if 'test "ON" = "$TMUX_SHOW_CPU_LOAD"' 'CPU_LOAD="tmux-mem-cpu-load --colors --interval 2"'
set -g status on
set -g status-interval 2
set -g status-position "top"
set -g status-justify "centre"
set -g status-left-length 100
set -g status-right-length 100
set -g status-left '#[fg=colour232,bg=colour154] #S:#I.#P #[fg=colour154,bg=colour33,nobold,nounderscore,noitalics]#[fg=colour230,bg=colour33] #(whoami)@#h #[fg=colour33,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] #(lan-ip.sh) #(up.sh) up '
set -g status-right '#(#{CPU_LOAD}) #[fg=colour121,bg=colour235] %a %Y-%m-%d %R '
setw -g window-status-format '#[default] #I:#W '
setw -g window-status-current-format '#[fg=colour222,bg=colour238] #I:#W #F '
if 'test -n "${TMUX_STATUS_POSITION}"' 'set -g status-position "${TMUX_STATUS_POSITION}"'
# -- color ---------------------------------------------------------------------
#### COLOUR (Solarized 256)
# default statusbar colors
set -g status-bg colour235 #base02
set -g status-fg colour136 #yellow
# set -g status-attr default
# default window title colors
# setw -g window-status-fg colour244 #base0
# setw -g window-status-bg default
# setw -g window-status-attr dim
# active window title colors
# setw -g window-status-current-fg colour166 #orange
# setw -g window-status-current-bg default
# setw -g window-status-current-attr bright
# pane border
# set -g pane-border-fg colour235 #base02
# set -g pane-active-border-fg colour240 #base01
# message text
# set -g message-bg colour235 #base02
# set -g message-fg colour166 #orange
# pane number display
set -g display-panes-active-colour colour33 #blue
set -g display-panes-colour colour166 #orange
# clock
setw -g clock-mode-colour colour64 #green
# -- plugin --------------------------------------------------------------------
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'jbnicolai/tmux-fpp'
set -g @resurrect-processes 'emacsclient neomutt ~offlineimap.py'
set -g @open-S 'https://www.google.com/search?q='
set -g @resurrect-hook-post-restore-all 'tmux.sh kill-session -t zombie'
run '~/.tmux/plugins/tpm/tpm'