-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
242 lines (188 loc) · 6.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
#
#------------------------------------------------------------------------------
# DEFAULT CONFIGURATION
#------------------------------------------------------------------------------
set-option -g focus-events on
# default colors configuration (needed for vim)
# set-environment -g CHERE_INVOKING 1
# set-option -g default-shell /bin/zsh
set -g default-shell /bin/zsh
## this will fix the colors in vim and neovim
# set -g default-terminal "screen.xterm-256color"
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# set -ga terminal-overrides ",*256col*:Tc"
# set -s escape-time 0
set -sg escape-time 0
set -g display-panes-time 5000
## Enable mouse by default
set -g mouse on
# unicode
# set-window-option -g utf8 on
## Set screensaver on timeout
# set -g lock-after-time 3000
# set -g lock-command /usr/bin/cmatrix
## start window index
# set -g base-index 0
## start panes at 1 instead of 0
# setw -g pane-base-index 1
# Start windows and panes at 0/1
set -g base-index 0
setw -g pane-base-index 0
## display messages for a second
set -g display-time 1000
## prevent tmux to rename windows
set -g set-titles on
setw -g automatic-rename on
# set -g allow-rename on
## set automatic title
# set-window-option -g automatic-rename off
# set-option -g status-interval 1
# set-option -g automatic-rename on
# set-option -g automatic-rename-format '#{b:pane_current_path}'
# set -g allow-rename on
## Set window notifications
#set-window-option -g monitor-activity on
#set -g visual-activity on
set -g history-limit 5000
#------------------------------------------------------------------------------
# SHORTCUT
#------------------------------------------------------------------------------
## Use vim keybindings in copy mode
setw -g mode-keys vi
unbind [
bind [ copy-mode
unbind ]
bind ] paste-buffer
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-selection
# bind -t vi-copy 'V' rectangle-toggle
# bind -t vi-copy Escape cancel
# Sync panes - send what you're typing to other panes.
# bind C-s set-window-option synchronize-panes
# move tmux copy buffer into x clipboard
# bind-key C-y run "tmux save-buffer - | xclip -i -selection clipboard"
## Repeat the command multiple times
bind -r p select-window -t :-
bind -r n select-window -t :+
# go to previous window (Ctr-B)
# bind b select-window -l
bind-key -n C-b select-window -l
## swap windows (CTRL+SHIFT+(Left|Right)
# swap window to left or right
bind-key -r < swap-window -t -1\; select-window -t -1
bind-key -r > swap-window -t +1\; select-window -t +1
bind-key -n C-S-Right swap-window -t -1\; select-window -t -1
bind-key -n C-S-Left swap-window -t +1\; select-window -t +1
## Join windows: <prefix> s, <prefix> j
bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key S command-prompt -p "send pane to:" "join-pane -t '%%'"
bind-key B command-prompt -p "break pane:" "break-pane "
#bind-key -n S-F1 select-pane -t :.+ # next pane
#bind-key -n S-F2 select-window -t :- # previous window
#bind-key -n S-F3 select-window -t :+ # next window
## changing default prefix to CTRL+x
set -g prefix C-x
unbind C-b
bind C-x send-prefix
## changine default window split
## unbind %
bind '"' split-window -h -c "#{pane_current_path}"
bind % split-window -v -c "#{pane_current_path}"
## better defaults
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
## reload .tmux.conf
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded master"
## ctrl+left/right cycles thru windows
bind-key -n C-right next
bind-key -n C-left prev
## select panes
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R
## alt+directions navigates through panes
bind-key -n M-left select-pane -L
bind-key -n M-right select-pane -R
bind-key -n M-up select-pane -U
bind-key -n M-down select-pane -D
## vim keys to move between panes
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
## go back to last window
bind -n M-l last-window
# bind -r b last-window
# Moye between panes on mac os
# with shift/left,right
bind -n S-Right next-window
bind -n S-Left previous-window
## quit tmux
#bind \ kill-server
## show panes numbers
bind-key P display-panes
#------------------------------------------------------------------------------
# COLOURS
#------------------------------------------------------------------------------
# color0 == black
# color15 == white
# color124 == red
# color240 == gray
# color250 == lightgray
# Show all colors in tmux :for i in {0..255} ; do printf "\x1b[38;5;${i}mcolour${i}\n"; done
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# STATUSBAR
#------------------------------------------------------------------------------
# UTF-8 character support in the status bar
# set-option -g status-utf8 on
# refresh the status bar every 1 second.
set-option -g status-interval 1000
#------------------------------------------------------------------------------
# BINDINGS
#------------------------------------------------------------------------------
## zoom pane without the prefix key
bind-key -n C-f resize-pane -Z
# bind-key -n C-b last-window
# Stay in copy mode on drag end.
# (Would use `bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X
# stop-selection` but it is a bit glitchy.)
unbind-key -T copy-mode-vi MouseDragEnd1Pane
## copy to clipboard
bind -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' \; 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" \; display-message "copied to system clipboard"
bind -T copy-mode-vi Y send -X copy-pipe-and-cancel "xclip -i -sel p -f | xclip -i -sel c" \; display-message "copied to system clipboard"
## synchronize panes on
bind s \
set -g synchronize-panes on \;\
display 'Synchronized panes ON'
## synchronize panes off
bind S \
set -g synchronize-panes off \;\
display 'Synchronized panes OFF'
## Toggle mouse on with ^B m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
## Toggle mouse off with ^B M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
## Switch between panes and zoom
bind O \
select-pane -t :.+ \;\
resize-pane -Z
# Tmux theme
# run-shell ~/.config/tmux/themes/tmux-onedark-theme/tmux-onedark-theme.tmux
run-shell ~/dotfiles/.config/tmux/themes/tmux-onedark-theme/tmux-onedark-theme.tmux
# Plugin Manager for tmux
# set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-sensible'
# Themes
# set -g @plugin "arcticicestudio/nord-tmux"
# set -g @plugin 'odedlaz/tmux-onedark-theme'
# must be last line in the file
# run -b '~/.tmux/plugins/tpm/tpm'