-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
281 lines (228 loc) · 8.84 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
# Set prefix to space.
#unbind C-b
unbind C-Space
unbind M-Space
# Set prefix & prefix2 to M-Space only
#set-option -g prefix M-Space
#bind-key M-Space send-prefix
set-option -g prefix C-b
bind-key C-b send-prefix
#set-option -g prefix2 M-Space
#bind-key M-Space send-prefix -2
set-option -g prefix2 C-b
bind-key C-b send-prefix -2
set -sg escape-time 0
# Set prefix & prefix2 to M-Space only
# and C-b used for remote tmux session (tmux inside tmux)
#set -g prefix C-b
#bind C-b send-prefix
#set -g prefix2 M-Space
#bind M-Space send-prefix -2
# Bindings:
# - to see current bindings:
# list-keys -t {vi,emacs}-{edit,choice,copy}
# Reload config file
bind r source-file ~/.tmux.conf \; display-message "Reloading Config..."
# Open new/split panes with the path of the current pane.
unbind c
bind c new-window -c '#{pane_current_path}'
unbind %
bind % split-window -h -c '#{pane_current_path}'
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}'
################ NAVIGATION: #############
# Vim-like key bindings for pane navigation (default uses cursor keys).
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# # # # # # # # # # # # #
# 0 is too far from ` ;)
set -g base-index 1
#set -g default-terminal "xterm"
#set -g default-terminal "xterm-256color"
set -g default-terminal "tmux-256color"
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
setw -g mouse on
setw -g mode-keys vi
setw -g monitor-activity on
# Use Alt-arrow keys without prefix key to switch panes
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
# Shift arrow to switch windows
bind -n M-Left previous-window
bind -n M-Right next-window
bind -n M-z previous-window
bind -n M-x next-window
bind -n M-H previous-window
bind -n M-L next-window
# No delay for escape key press
set -sg escape-time 0
##########################################
# Resizing (mouse also works).
unbind Left
bind -r Left resize-pane -L 5
unbind Right
bind -r Right resize-pane -R 5
unbind Down
bind -r Down resize-pane -D 5
unbind Up
bind -r Up resize-pane -U 5
# Fast toggle (normally prefix-l).
#bind ^space last-window
bind M-Space last-window
# Intuitive window-splitting keys.
#bind | split-window -h -c '#{pane_current_path}' # normally prefix-%
#bind \ split-window -h -c '#{pane_current_path}' # normally prefix-%
#bind - split-window -v -c '#{pane_current_path}' # normally prefix-"
# Statusbar.
set -g status-position top
#set -g status-justify centre
#set -g status-justify left
set -g status-bg '#343d46'
set -g status-fg white
set -g status-left-length 30
#set -g status-left '#[fg=yellow]#S ⧉ '
#set -g status-left '#[fg=yellow]$USER@#h ⧉ #S '
set -g status-left " #[fg=yellow] ⧉ #S "
set -g status-right-length 50
#set -g status-right "#[fg=yellow]$USER@#h #[fg=magenta] %A %h %Y-%m-%d %H:%M %p"
#set -g status-right "#[fg=magenta] %A %h %Y-%m-%d %H:%M %p"
set -g status-right "#[fg=yellow]$USER@#h %Y-%m-%d %H:%M %p"
# Highlight active window old version
#set -w -g window-status-current-bg red
# Highlight active window on version 2.9+
# ISSUE: https://github.com/tmux/tmux/issues/1689
set -w -g window-status-current-style bg=red
set -g status-interval 60 # Default is 15.
#set -w -g window-status-format "#I. #W#{?window_flags,#{window_flags},}"
#set -w -g window-status-current-format "#I. #W#{?window_flags,#{?window_flags},}"
set -w -g window-status-format " #I #W "
set -w -g window-status-current-format " #I #W "
# Window statusbar
#set -g window-status-format " #{?window_activity_flag, #[fg=colour231]#[blink],#[fg=colour245]}#{?window_bell_flag,#[fg=colour01]#[blink],#[fg=colour245]} #W "
#set -g window-status-style 'bg=colour232'
#set -g window-status-activity-style 'bg=colour232,fg=colour247,blink'
#set -g window-status-bell-style 'bg=colour232,fg=colour01,blink'
#set -g window-status-current-style 'bg=colour232,fg=colour09'
#set -g monitor-activity on
# #T = standard window title (last command, see ~/.bash_profile)
# #h = short hostname
# #S = session name
# #W = tmux window name
#
# (Would love to include #(pwd) here as well, but that would only print the
# current working directory relative to the session -- ie. always the starting
# cwd -- which is not very interesting).
set -g set-titles-string "#T : #h > #S > #W"
# Show bells in window titles.
set -g window-status-bell-style fg=yellow,bold,underscore
# Automatically renumber window numbers on closing a pane (tmux >= 1.7).
set -g renumber-windows off
# Mouse can be used to select panes, select windows (by clicking on the status
# bar), resize panes. For default bindings see `tmux list-keys` and `tmux
# list-keys -t vi-copy`.
set -g mouse on
setw -g mode-keys vi
# Restore pre-2.1 behavior of scrolling with the scrollwheel in Vim, less, copy
# mode etc, otherwise entering copy mode if not already in it.
#
# if in copy mode (pane_in_mode) || using the mouse already (mouse_any_flag)
# pass through mouse events to current pane (send -Mt=)
# elsif in alternate screen mode
# send `Up` key
# else
# enter copy mode (-e exits if we scroll to the bottom)
# end
#bind-key -T root WheelUpPane \
# if-shell -Ft= '#{?pane_in_mode,1,#{mouse_any_flag}}' \
# 'send -Mt=' \
# 'if-shell -Ft= "#{alternate_on}" "send -t= Up" "copy-mode -et="'
#
#bind-key -T root WheelDownPane \
# if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
# 'send -Mt=' \
# 'if-shell -Ft= "#{alternate_on}" "send -t= Down" "send -Mt="'
# Stay in copy mode on drag end, but otherwise exit for mouse up.
# Requires patch from https://github.com/tmux/tmux/issues/326
#unbind-key -T vi-copy MouseDragEnd1Pane
#bind-key -T vi-copy MouseUp1Pane cancel
# For those times when C-c and q are not enough.
#bind-key -t vi-copy Escape cancel
# Slightly more useful width in "main-vertical" layout; enough room for 3-digit
# line number gutter in Vim + 80 columns of text + 1 column breathing room
# (default looks to be about 79).
set -w -g main-pane-width 85
#set -g default-terminal "tmux-256color"
#set -ga terminal-overrides ',xterm-256color:Tc'
# set default shell
#set -g default-shell /usr/bin/fish
set -g default-shell /bin/bash
set -g default-command /bin/bash
# set default history
set -g history-limit 200000
# Start window and pane numbering at 1, (0 is too hard to reach).
set -g base-index 1
set -g pane-base-index 1
# Don't wait for an escape sequence after seeing C-a.
set -s escape-time 0
# Dynamically update iTerm tab and window titles.
set -g set-titles on
# Needed as on tmux 1.9 and up (defaults to off).
# Added in tmux commit c7a121cfc0137c907b7bfb.
set -g focus-events on
# But don't change tmux's own window titles.
set -w -g automatic-rename off
# Don't wrap searches; it's super confusing given tmux's reverse-ordering of
# position info in copy mode.
set -w -g wrap-search off
# copy paste on copy mode for tmux version =2.3
#bind-key -t vi-copy 'v' begin-selection
#bind-key -t vi-copy 'y' copy-pipe "xclip -in -selection clipboard"
# copy paste on copy mode for tmux version +=2.4
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe "xclip -in -selection clipboard"
# old config
#bind -T copy-mode-vi y send -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c" \; display-message "copied to system clipboard"
#bind -T copy-mode-vi y send -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c"\;
#bind-key -T copy-mode-vi v send-keys -X begin-selection
#######################################################################
# PLUGINS Ref: https://github.com/tmux-plugins/tpm #
# PLUGINS Ref: https://github.com/tmux-plugins #
# $ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm #
#######################################################################
# List of plugins
# Key bindings
# * Prefix + I
# Installs new plugins from GitHub or any other git repository
# Refreshes TMUX environment
# * Prefix + U
# Updates plugin(s)
# * prefix + alt + u
# remove/uninstall plugins not on the plugin list
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# My Plugins:
# For saving session
# * prefix + S - save
# * prefix + R - restore
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-dir '~/.tmux/session'
# For countinue saving session
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
# Must End
################################################################