-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
304 lines (248 loc) · 8.78 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
# .tmux.conf
# http://www.openbsd.org/cgi-bin/man.cgi?query=tmux&sektion=1
# http://tmux.git.sourceforge.net/git/gitweb.cgi?p=tmux/tmux;a=blob;f=FAQ
#######################################
# Global Settings
#######################################
# Unicode =============================
# set-window-option -g utf8 on # invalid option: utf8
set-window-option -g mode-keys vi # emacs|vi
#set-window-option -g automatic-rename off
# =====================================
# Terminal Coloring ===================
set-option -g default-terminal "screen-256color"
# =====================================
# Key Bindings ========================
## Help
unbind ^?
bind ? list-keys
## Changing prefix
unbind C-b
set -g prefix ^W
bind w send-prefix
## Detach
unbind ^D
bind ^D detach
## List Clients
unbind *
bind * list-clients
## Copy Mode
unbind ^"["
bind -r ^"[" copy-mode
## Paste Buffer
unbind ^]
bind -r ^] paste-buffer
## Refresh Client
unbind ^R
bind ^R refresh-client
unbind r
bind r refresh-client
## Kill Server
unbind '\'
bind '\' confirm-before "kill-server"
# =====================================
# Mouse Operation =====================
# set-option -g mode-mouse on # invalid option: mode-mouse
# set-option -g mouse-utf8 on # invalid option: mouse-utf8
# =====================================
# Buffer handling =====================
set-option -g buffer-limit 32
#set-option -g default-command 'reattach-to-user-namespace -l zsh' # Mac OS X ONLY!!
#bind C-q run-shell 'reattach-to-user-namespace tmux-pbcopy'
# =====================================
# tmuxinator ==========================
set-window-option -g pane-base-index 1
# =====================================
# Others ==============================
set -s escape-time 0
set-option -g history-limit 4096
# =====================================
#######################################
# Window Settings
#######################################
# Key Bindings ========================
## New Window
unbind ^C
bind ^C new-window -n zsh
bind c new-window -n zsh
## Next Window
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window
## Previous Window
unbind ^p
bind ^p previous-window
unbind p
bind p previous-window
## Last Window
unbind ^A
bind ^A last-window
## List Windows and Choose one
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows
unbind '"'
bind '"' choose-window
## Rename the Window
unbind A
bind A command-prompt "rename-window %%"
## Kill the Window
unbind k
bind k confirm-before "kill-window"
## Split the Window Vertically (Add a pane horizontally)
unbind |
bind | split-window -h
## Split the Window Horizontally (Add a pane vertically)
unbind -
bind - split-window -v
# =====================================
# Mouse Operation =====================
# set-option -g mouse-select-window on # invalid option: mouse-select-window
# =====================================
# Coloring ============================
# set-window-option -g mode-bg white # invalid option: mode-bg
# set-window-option -g mode-fg black # invalid option: mode-fg
# =====================================
# Others ==============================
# =====================================
#######################################
# Pane Settings
#######################################
# Key Bindings ========================
## Kill the Pane
unbind K
bind K kill-pane
## Select a Pane
unbind Tab
bind Tab select-pane -t :.-
unbind BTab
bind BTab select-pane -t :.+
unbind ^H
bind ^H select-pane -t :.-
unbind h
bind ^h select-pane -t :.-
unbind ^L
bind ^L select-pane -t :.+
unbind l
bind l select-pane -t :.+
# =====================================
# Mouse Operation =====================
# set-option -g mouse-select-pane on # invalid option: mouse-select-pane
# set-option -g mouse-resize-pane on # invalid option: mouse-resize-pane
# =====================================
# Coloring ============================
# set -g pane-border-fg colour245 # invalid option: pane-border-fg
# set -g pane-active-border-bg black # invalid option: pane-active-border-bg
# set -g pane-active-border-fg colour202 # invalid option: pane-active-border-fg
# =====================================
# Others ==============================
# =====================================
#######################################
# Status Line Settings
#######################################
# Key Bindings ========================
# =====================================
# tmux-powerline ======================
set-option -g status on
set-option -g status-interval 15
# set-option -g status-utf8 on # invalid option: status-utf8
#set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-left "#(~/.tmux/tmux-powerline/status-left.sh)"
set-option -g status-right "#(~/.tmux/tmux-powerline/status-right.sh)"
# =====================================
# Coloring ============================
# set-window-option -g window-status-bg black # invalid option: window-status-bg
# set-window-option -g window-status-fg white # invalid option: window-status-fg
# set-window-option -g window-status-current-bg blue # invalid option: window-status-current-bg
# set-window-option -g window-status-current-fg black # invalid option: window-status-current-fg
# set-window-option -g window-status-current-attr bold # invalid option: window-status-current-attr
set -g status-fg white
set -g status-bg colour234
# set -g window-status-activity-attr bold # invalid option: window-status-activity-attr
# set -g message-fg colour16 # invalid option: message-fg
# set -g message-bg colour221 # invalid option: message-bg
# set -g message-attr bold # invalid option: message-attr
# =====================================
# Displaying ==========================
set-option -g display-time 5000
# setw -g window-status-current-attr underscore # invalid option: window-status-current-attr
# set -g status-attr dim # invalid option: status-attr
set -g status-left '#[fg=white,bg=black,bold]S#S I#I P#P #[fg=black,bg=colour202,bold]#20(whoami)@#h#[default] ['
set -g status-left-length 32
set -g status-right-length 150
# set -g window-status-activity-attr bold # invalid option: window-status-activity-attr
set -g window-status-format "#[fg=white,bg=colour234]#I.#W"
#set -g window-status-current-format "#[fg=colour234,bg=colour39,noreverse,bold]#I*#W"
set -g window-status-current-format "#[fg=white,bg=magenta,noreverse,bold]#I*#W"
set -g status-right "] #[fg=colour255,bg=colour234] Batt[#(~/bin/battery Discharging)#(~/bin/battery Charging)]#(uptime | cut -d "," -f 3- | sed 's/load averages: /Ld.Avg[/g')] #[fg=colour234,bg=colour255,bold]%Y-%m-%d %H:%M %a#[default]"
# set -g message-attr bold # invalid option: message-attr
# set -g message-fg white # invalid option: message-fg
# set -g message-bg red # invalid option: message-bg
# =====================================
# Nesting =============================
unbind C-q
set -g prefix C-w
set -g status-bg colour007
# setw -g window-status-current-bg colour007 # invalid option: window-status-current-bg
bind -n C-t new-window -a
bind -n S-left prev
bind -n S-right next
bind -n S-C-left swap-window -t -1
bind -n S-C-right swap-window -t +1
bind -n M-F11 set -qg status-bg colour000
bind -n M-F12 set -qg status-bg colour007
bind -n S-up \
send-keys M-F12 \; \
set -qg status-bg colour000 \; \
unbind -n S-left \; \
unbind -n S-right \; \
unbind -n S-C-left \; \
unbind -n S-C-right \; \
unbind -n C-t \; \
set -qg prefix C-q
bind -n S-down \
send-keys M-F11 \; \
set -qg status-bg colour007 \; \
bind -n S-left prev \; \
bind -n S-right next \; \
bind -n S-C-left swap-window -t -1 \; \
bind -n S-C-right swap-window -t +1 \; \
bind -n C-t new-window -a -c "#{pane_current_path}" \; \
set -qg prefix C-w
# =====================================
# Others ==============================
# =====================================
#######################################
# Plugins
#######################################
# tpm (Tmux Plugin Manager) ===========
# set -g @tpm_plugins ' \
# tmux-plugins/tpm \
# tmux-plugins/tmux-yank \
# tmux-plugins/tmux-open \
# tmux-plugins/tmux-resurrect \
# tmux-plugins/tmux-battery \
# tmux-plugins/tmux-pain-control \
# '
# run-shell '~/.tmux/plugins/tpm/tpm'
# =====================================
# tmux-resurrect ======================
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes 'ssh mosh mysql postgresql python irb pry "~rails server" "~rails console"'
set -g @continuum-restore 'on'
run-shell '~/.tmux/plugins/tpm/tpm'
# =====================================