-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
executable file
·223 lines (172 loc) · 6.47 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
# ---------------------
# Configuration
# ---------------------
# use UTF8 unicode
set -g utf8
set-window-option -g utf8 on
set -g status-utf8 on
# make tmux display things in 256 colors
# local .bashrc needs to have: export TERM=xterm-256color
set -g default-terminal "xterm-256color"
# set scrollback history to 10000 (10k)
set -g history-limit 10000
# shorten command delay
set -sg escape-time 1
# visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
#bind $ rename-session
# ---------------------
# New Keyboard Bindings
# ---------------------
# set Ctrl-a as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-a
unbind C-b
# use send-prefix to pass C-a through to application
bind C-a send-prefix
# rebind clear screen with Ctrl-l
bind C-l send-keys 'C-l'
# reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.tmux.conf \; display "Config reloaded"
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind \ split-window -h -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# make the current window the first window
bind T swap-window -t 1
#keep directory on new window
bind c new-window -c "#{pane_current_path}"
# setup tab to switch windows
bind tab last-window
# map pane switching with ALT+Arrow keys
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# toggle zoom
bind b break-pane
# join windows
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# toggle mouse on
unbind-key -n F8
bind-key -n F8 \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# 9/16/2014 5:04:08 PMtoggle mouse off
unbind-key -n F9
bind-key -n F9 \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# ---------------------
# Mouse
# ---------------------
# switch panes by using the mouse (turns off the ability to select text for local clipboard copy!)
# setw -g mouse-utf8 on
# set -g mode-mouse on
# setw -g mode-mouse on
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# set-option -g mouse-select-pane on
# setw -g mouse-select-window on
# setw -g mouse-resize-pane on
# OR explicitly disable mouse control
#setw -g mode-mouse off
#set -g mouse-select-pane off
#set -g mouse-resize-pane off
#set -g mouse-select-window off
# ---------------------
# Copy & Paste
# ---------------------
# setup reattach-to-user-namespace for copy and paste
# set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# set-window-option -g automatic-rename on
# ---------------------
# VIM
# ---------------------
# use vim keybindings in copy mode
# setw -g mode-keys vi
# setup 'v' to begin selection as in Vim
# bind-key -t vi-copy v begin-selection
# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# update default binding of 'Enter' to also use copy-pipe
# unbind -t vi-copy Enter
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
# bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
# set copy-mode settings
# bind [ copy-mode
# bind -t vi-copy v begin-selection
# bind -t vi-copy y copy-selection
# bind -t vi-copy V rectangle-toggle
# bind ] paste-buffer
# map Vi movement keys as pane movement keys
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# and use C-h and C-l to cycle thru panes
# bind -r C-h select-window -t :-
# bind -r C-l select-window -t :+
# resize panes using PREFIX H, J, K, L
# bind H resize-pane -L 5
# bind J resize-pane -D 5
# bind K resize-pane -U 5
# bind L resize-pane -R 5
# ----------------------
# Pane Highlighting
# ----------------------
# Options: black red yellow green blue magenta cyan white
# or write "colour\d+", e.g. "colour5" or "colour170"
#
# set pane colors - hilight the active pane
# inactive border
set-option -g pane-border-fg colour235 # dark gray
set-option -g pane-border-bg colour233 # super dark gray
# active border
set-option -g pane-active-border-fg white # white
set-option -g pane-active-border-bg colour233 # super dark gray
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-interval 1 # 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
# set color for status bar
# set-option -g status-attr dim
set-option -g status-bg colour234
set-option -g status-fg white
# status left options
set-option -g status-left-length 80
set-option -g status-left "#[fg=colour240](#[bg=default,fg=colour255]#H#[fg=colour240])-(#[bg=default,fg=colour39]#S#[fg=colour240])"
# window list options
setw -g automatic-rename on
set-window-option -g window-status-format '#[fg=colour51,dim]#I#[fg=colour32]:#[fg=colour253]#W#[fg=colour253,dim]#F'
set-window-option -g window-status-current-format '#[bg=colour25,fg=colour51,bold]#I#[bg=colour25,fg=colour32]:#[fg=colour230]#W#[fg=dim]#F'
set -g base-index 1
# status right options
set-option -g status-right-length 80
set -g status-right "#[fg=colour240](#[fg=colour39]%a %b %-m %Y#[fg=colour240])-(#[fg=colour255]%-I:%M:%S%P#[fg=colour240])"
# ----------------------
# Scripts
# -----------------------
# bind h source-file ~/.tmux/myfile
# 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=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}') "
# show session name, window & pane number, date and time on right side of
# status bar
set -g status-right-length 60
set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"#
run-shell ~/tmux-resurrect/resurrect.tmux