-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
349 lines (272 loc) · 9.16 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
# ----------------------
# PLUGINS
# ----------------------
# requires tmux version 1.9
#git clone https://github.com/tmux-plugins/tmux-open ~/.tmux/tmux-copycat
#run-shell ~/.tmux/tmux-copycat/copycat.tmux
#git clone https://github.com/tmux-plugins/tmux-open ~/.tmux/tmux-open
#run-shell ~/.tmux/tmux-open/open.tmux
################### detach -a
# detach all
# tmux detach -a
#bind M-d detach -a
#check tmuxdetacha alias
# space
# Esc
#default shell
# set-option -g default-shell "/usr/local/bin/zsh"
set-option -g update-environment "PATH"
# resize panes like vim
bind < resize-pane -L 25
bind > resize-pane -R 25
bind - resize-pane -D 10
bind + resize-pane -U 10
#
setw -g aggressive-resize on
#### rearrange/rotate pane (make vertical or make horizontal)
# Here is a jewel of a bind which does the task of flipping the orientation of the
# current pane with the pane before it (in the ordering)
bind M-f move-pane -t '.-'
bind M-r move-pane -h -t '.-'
# eXterminate pane
bind X kill-pane
# number windows and panes from 1
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
# move pane (aka. join-pane)
bind m command-prompt -p "send pane to:" "join-pane -t '%%'"
bind M choose-window "join-pane -t '%%'"
# break-pane
bind b break-pane
# C-a - as default preffix
unbind C-b
set -g prefix C-a
# nested ctrl-a
bind a send-prefix
# rename window `
# ### PLEASE USE THE DEFAULT ',' (comma)
# unbind A
# bind A command-prompt "rename-window %%"
# reload - force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# VI keybindings please - copy mode
setw -g mode-keys vi
# kolorki and start as tmux -2
set -g default-terminal "screen-256color"
# Set ability to capture on start and restore on exit window data when running an application
# prevent application clear screen on exit
# http://chenyufei.info/blog/2011-12-15/prevent-vim-less-clear-screen-on-exit/
setw -g alternate-screen off
#
# # Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
## ????
#http://superuser.com/questions/310251/use-terminal-scrollbar-with-tmux?lq=1
set -ga terminal-overrides 'screen*:smcup@:rmcup@'
# ----------------------
# clipboard
# ----------------------
# unbind "^]"
# bind "^]" copy-mode
# cancel copy
#unbind Escape
#bind -T vi-copy Escape cancel
# copy z ctrl
unbind c-[
bind c-[ copy-mode
# paste even with ctrl
unbind c-]
bind-key c-] paste-buffer
#
### VI: v-visual, y-yank
bind -T vi-copy 'v' begin-selection
bind -T vi-copy space begin-selection
bind -T vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode.
### default 'y'
bind -T vi-copy 'y' copy-selection
bind -T vi-copy Enter copy-selection
# OSX only
if-shell 'test "$(uname)" = "Darwin"' 'source ~/dotfiles/.tmux-osx.conf'
# Linux only (when DISPLAY is set to share clipboard with X)
# disabled even display is set becuase: wrong habits and is persistent with tmux sessions
#if-shell '[ "$(uname)" = "Linux" -a -n $DISPLAY ]' 'source ~/dotfiles/.tmux-linux.conf'
#checkout tmuxxcopy alias
#### history
unbind C
bind C send-keys -R enter \; clear-history
### VI: s -split horizontal
bind s split-window -v
### choose session
bind S choose-session
bind c-s switch-client -n
bind c-S switch-client -p
# verticaly |(shift/ctrl version on none) or v
bind | split-window -h
bind \ split-window -h
bind C-\ split-window -h
bind v split-window -h
# VI for switching between
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# VI (ctrl version)
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
# synchronization toggle - echo
bind e setw synchronize-panes
# don't wait after escape
set -s escape-time 0
# unicode/utf8
setw -g utf8 on
set -g status-utf8 on
# ---------------------
# window navigation
# easier and faster switching between next/prev window
bind C-p previous-window
bind C-n next-window
# swap windows (!!! withoyt prefix-key)
bind -n C-S-Left swap-window -t -1
bind -n C-S-Right swap-window -t +1
# swap
bind c-m command-prompt -p "swap window with :" "swap-window -t '%%'"
# last-window
unbind ^A
bind ^A last-window
# select window - leave the defautl - split horizonalty
# unbind '"'
# bind '"' choose-window
# last pane (like vi c-w, c-w)
unbind w
bind w last-pane
bind c-w last-pane
# ---------------------
# panes navigation
# ---------------------
# cycle panes
bind Tab select-pane -t :.+
# niedziala z jakiegos powodu - nie lapie
unbind S-Tab
bind S-Tab select-pane -t :.-
### SCROLL BACK HISTORY
# set scrollback history to 100k
# !WARNING it really slows down window resizing !!!
# set -g history-limit 100000
# set -g history-limit 500
# set -g history-limit 500
set -g history-limit 10000
# --------------------
# tmux snippets
# --------------------
bind u run-shell ~/dotfiles/bin/tmux-snippets.sh
# ----------------------
# mouse
# ----------------------
# for tmux < 2.9
source-file ~/dotfiles/.tmux-mouse.conf
# for tmux >= 2.9
#unbind t
#bind t set -g mouse on \; display 'Mouse: ON'
#unbind T
#bind T set -g mouse off \; display 'Mouse: OFF'
# ----------------------
# titles
# ----------------------
# client terminal
set-option -g set-titles on
set-option -g set-titles-string '[#S:#I #H] #W'
# my tab name
set-option -g allow-rename off
# ----------------------
# set some pretty colors
# ----------------------
# ########## PANE olors
# set pane colors - hilight the active pane
set -g pane-border-fg colour245 #szary
# set -g pane-border-fg colour245
set -g pane-active-border-fg colour160 # czerwony
# set -g pane-active-border-fg colour240 #base01
# ----------------------
# Status Bar
# -----------------------
set -g status on # turn the status bar on
set -g status-utf8 on # set utf-8 for the status bar
set -g status-interval 5 # set update frequencey (default 15 seconds)
# set -g status-justify centre # center window list for clarity
# set-option -g status-position top # position the status bar at top of screen
# visual notification of activity in other windows
setw -g monitor-activity off
# If on, display a status line message when activity occurs in a window
set -g visual-activity off
# ----------------------
# Status Bar - what to display
# -----------------------
#
set -g status-justify left
# show host name and IP address on left side of status bar
set -g status-left-length 70
# set -g status-left "#[fg=green]: #h : #[fg=brightblue]#(curl icanhazip.com) #[fg=yellow]#(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #[fg=red]#(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') "
# set -g status-left "#[fg=green]: #h"
set -g status-left ""
# show session name, window & pane number, date and time on right side of
# status bar
set -g status-right-length 100
# set -g status-right "#[fg=brightblue]#S #I:#P #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"
# set -g status-right "#[fg=yellow]#S:#I.#P #[fg=brightblue] #(date +%T)"
# ---------------------------
# tmux-top
# https://github.com/TomasTomecek/tmux-top
# go get github.com/TomasTomecek/tmux-top/cli
# mv $GOPATH/bin/{cli,tmux-top}
#
#
#set -g status-left "#(tmux-top net)" # no statistic available - check ~/.tmux-top sudo ethtool -S eno1
set -g status-right "#[fg=yellow]#S:#I.#P #[fg=brightblue] #(date +%T) #(tmux-top load) #(tmux-top net eno1)"
#set -g status-right "#[fg=yellow]#S:#I.#P #[fg=brightblue] #(date +%T) #(tmux-top mem) #(tmux-top load) #(tmux-top io) #(tmux-top net eno1)"
# ---------------------------
# COLORS
# ---------------------------
# colorize messages in the command line
# set-option -g message-bg black #base02
# set-option -g message-fg brightred #orange
# ----------------------
# Status Bar - colors
# -----------------------
# set -g status-bg default
# show default values
# tmux -L unconfigured -f /dev/null start-server \; list-keys \; show-options -s \; show-options -g \; show-options -gw
# set color for status bar (orange on black?)
set -g status-bg colour235 #base02
set -g status-fg yellow #looks like orange
#set -g status-attr default
# set -g status-attr dim
# setw -g window-status-fg default
# setw -g window-status-bg default
# setw -g window-status-current-fg default
# setw -g window-status-current-bg default
# set window list colors - red for active and cyan for inactive
# setw -g window-status-fg brightblue #base0
# setw -g window-status-bg colour236
# setw -g window-status-attr dim
# Current or active window in status bar
# setw -g window-status-current-fg brightred
# setw -g window-status-current-fg black
# setw -g window-status-current-bg default
# setw -g window-status-current-bg yellow
### reverse wzgledem yellow on black
setw -g window-status-current-style reverse
### --------------------- alert
# Alerted window in status bar. Windows which have an alert (bell, activity or content).
# setw -g window-status-alert-fg red
# setw -g window-status-alert-bg white
### ---------------------- activity
# setw -g window-status-activity-bg default
# setw -g window-status-activity-fg yellow
# setw -g window-status-activity-attr none
#run-shell ~/work/tmux-resurrect/resurrect.tmux
# HOST NAME is long
status-left-length 20