-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
217 lines (162 loc) · 8.27 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
# TMUX_COLORTAG_TAG_ONLY=yes
# colortag_bg0='#000000'
# colortag_bg1='#000000'
# set -g default-terminal "${TERM}"
set -ga terminal-overrides ",xterm-kitty:Tc"
# Undercurl
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
set -g default-shell /bin/zsh
# no delay after pressing esc key (useful for vim)
set -s escape-time 0
set-option -g prefix C-Space
unbind Space
setw -g mouse on
# use vi mode
set-window-option -g mode-keys vi
set -s set-clipboard off
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
if-shell "uname | grep -q Darwin" {
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'pbcopy' -x
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy' -x
# Copy and exit
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'pbcopy' -x
} {
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' -x
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' -x
# Copy and exit
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' -x
}
# Exit copy mode
bind-key -T copy-mode-vi Escape send-keys -X cancel
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind -n M-a select-pane -l
# bind -r h select-pane -L
# bind -r j select-pane -D
# bind -r k select-pane -U
# bind -r l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Conflicts with vim
# bind-key -n F3 resize-pane -Z
# bind h select-window -t :-
# bind l select-window -t :+
# bind-key -r C-h select-pane -L
# bind-key -r C-j select-pane -D
# bind-key -r C-k select-pane -U
# bind-key -r C-l select-pane -R
# soften status bar color from harsh green to light gray
set -g status-bg '#151515'
set -g status-fg '#A1B0B8'
# remove administrative debris (session name, hostname, time) in status bar
# set -g status-right ''
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 20000
# window title in window bar
set -g set-titles on
set -g set-titles-string '#T'
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
# setw -g aggressive-resize on
# improve colors
set-option -ga terminal-overrides ",xterm-256color:Tc"
# set inactive/active window styles
# set -g window-style 'fg=colour247,bg=colour236'
# set -g window-active-style 'fg=colour250,bg=black'
# set -g window-style 'fg=colour247,bg=colour247'
# set -g window-active-style 'fg=colour250,bg=default'
# # set -g pane-border-fg colour250
# # set -g pane-border-bg default
# set-option -g pane-active-border-style "bg=default"
# set-option -ag pane-active-border-style "fg=colour250"
# customize right status to show prefix mode and nothig else
# set -g status-right ' #{?client_prefix,#[reverse]** TMUX PREFIX MODE **#[noreverse] ,}'
bind '%' split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
bind c new-window -c '#{pane_current_path}' # Create new window
bind-key 'C-\' send-keys 'C-z' 'kill -9 %1' Enter
# bind-key 'C-\' send-keys 'C-z'; sleep 1; 'kill -9 %1' Enter
# List of plugins
# set -g @plugin 'thewtex/tmux-mem-cpu-load'
# set -g @plugin 'tmux-plugins/tmux-yank'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'laktak/extrakto'
# set -g @plugin 'Determinant/tmux-colortag'
# set -g @plugin 'christoomey/vim-tmux-navigator'
# set -g @plugin 'Morantron/tmux-fingers'
# Enter copy mode and search for errors with regex or word FATAL backwards *requires tmux-copycat
# set -g @copycat_search_C-e '([a-z]+Error([a-z]+)?|FATAL)'
# set-option -g status on
# set-option -g status-interval 2
# 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/plugins/tmux-powerline/powerline.sh left)"
# set-option -g status-right "#(~/.tmux/plugins/tmux-powerline/powerline.sh right)"
# set-window-option -g window-status-current-format "#[fg=colour235, bg=colour27]⮀#[fg=colour255, bg=colour27] #I ⮁ #W #[fg=colour27, bg=colour235]⮀"
# set-window-option -g window-status-current-format "#[fg=colour235, bg=default]⮀#[fg=colour255, bg=default] #I ⮁ #W#[fg=colour27, bg=default]⮀"
# Make tmux-fingers yank into proper clipboard
# set -g @fingers-copy-command 'xclip -in -selection clipboard'
# set -g @fingers-copy-command-uppercase 'xclip -in -selection clipboard'
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
# tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
# if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
# if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
set -g @extrakto_grab_area 'window full'
# bind-key -T copy-mode-vi 'C-h' select-pane -L
# bind-key -T copy-mode-vi 'C-j' select-pane -D
# bind-key -T copy-mode-vi 'C-k' select-pane -U
# bind-key -T copy-mode-vi 'C-l' select-pane -R
# bind-key -T copy-mode-vi 'C-\' select-pane -l
# set -g @resurrect-capture-pane-contents 'on'
# set -g @resurrect-processes ':all:'
set -g pane-border-status top
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# TokyoNight colors for Tmux
set -g mode-style "fg=#7aa2f7,bg=#3b4261"
set -g message-style "fg=#7aa2f7,bg=#3b4261"
set -g message-command-style "fg=#7aa2f7,bg=#3b4261"
set -g pane-border-style "fg=#3b4261"
# set -g pane-active-border-style "fg=#7aa2f7"
set -g pane-border-style "fg=#7aa2f7,bg=#333333"
set -g pane-active-border-style "fg=#ffffff,bg=terminal"
set -g window-style 'fg=terminal,bg=#333333'
set -g window-active-style 'fg=terminal,bg=terminal'
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=#7aa2f7,bg=terminal"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#15161E,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161E,bg=#7aa2f7,bold] #h "
setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-format "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[default] #I #W #F #[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#1f2335,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I #W #F #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]"
# When scrolling with mouse wheel, reduce number of scrolled rows per tick (default is 5)
bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 1 scroll-up
bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 1 scroll-down