-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
234 lines (194 loc) · 7 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
%hidden COPY_CMD="command -v pbcopy >/dev/null && pbcopy -pboard general || xclip -i -selection clip"
# Better prefix
set -g prefix C-Space
unbind C-b
# For smart pane switchin with Vim, see bindings
set -g set-titles on
# Enable all the mouse support
setw -g mouse on
unbind -n MouseDown3Pane # disable right-click menu
bind -n WheelUpPane {
selectp -t=
if -Ft= "#{mouse_any_flag}" {
send -M
} {
if -Ft= "#{alternate_on}" {
send up
} {
copy-mode -e
send -M
}
}
}
bind -n WheelDownPane {
selectp -t=
if -Ft= "#{mouse_any_flag}" {
send -M
} {
if -Ft= '#{alternate_on}' {
send Down
} {
send -M
}
}
}
bind -T copy-mode-vi C-WheelUpPane send -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send -X halfpage-down
unbind -T copy-mode-vi MouseDragEnd1Pane
bind -T copy-mode-vi MouseDown1Pane { select-pane; send -X clear-selection }
bind -n DoubleClick1Pane {
select-pane -t=
copy-mode -M
run -b '~/.tmux/smart-word.sh #{q:copy_cursor_line} #{copy_cursor_x}'
}
bind -T copy-mode-vi DoubleClick1Pane {
select-pane -t=
send -X clear-selection
run -b '~/.tmux/smart-word.sh #{q:copy_cursor_line} #{copy_cursor_x}'
}
bind -n C-Doubleclick1Pane {
select-pane -t=
copy-mode -M
send -X begin-selection
send -X end-of-line
}
bind -n TripleClick1Pane {
select-pane -t=
copy-mode -M
send-keys -X select-line
}
bind -T copy-mode-vi TripleClick1Pane {
select-pane -t=
send-keys -X select-line
}
# Things work better with this
setw -g xterm-keys on
set -ga terminal-features ",alacritty*:RGB:hyperlinks:usstyle"
# Better for Vim
set -sg escape-time 1
# Better indexing
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Everyone's doing it...
setw -g aggressive-resize on
# Show running command in window tab
setw -g automatic-rename on
# More to scroll back to
set -g history-limit 50000
set -g display-time 5000
set -g display-panes-time 5000
# enable focus events for terms that support them
set -g focus-events on
# Prevent C-d killing tmux
set-environment -g 'IGNOREEOF' 2
# Vim-style keys for copy-mode
set -g mode-keys vi
# No search wrapping
set -g wrap-search off
# This tmux statusbar config was created by tmuxline.vim on Mon, 26 Aug 2019
# In vim run `:Tmuxline airline | TmuxlineSnapshot tmux.colors.conf`
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#ffffff,bg=#444444"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#dfff00"
set -g status-style "none,bg=#202020"
set -g message-style "fg=#ffffff,bg=#444444"
set -g pane-border-style "fg=#888888"
set -g status-right-length "200"
set -g status-left-length "100"
setw -g window-status-activity-style "none"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=#9cffd3,bg=#202020"
set -g status-left "#[fg=#00005f,bg=#dfff00] #S #[fg=#dfff00,bg=#202020,nobold,nounderscore,noitalics]"
set -g status-right "#(~/.tmux/status.sh)#[fg=#444444,bg=#202020,nobold,nounderscore,noitalics]#[fg=#ffffff,bg=#444444] %Y-%m-%d %H:%M #[fg=#dfff00,bg=#444444,nobold,nounderscore,noitalics]#[fg=#00005f,bg=#dfff00] #h "
setw -g window-status-format "#[fg=#9cffd3,bg=#202020] #I #[fg=#9cffd3,bg=#202020] #W "
setw -g window-status-current-format "#[fg=#202020,bg=#444444,nobold,nounderscore,noitalics]#[fg=#ffffff,bg=#444444] #I #[fg=#ffffff,bg=#444444] #W #[fg=#444444,bg=#202020,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=colour234,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour255,bg=colour238] #I: #[fg=colour255,bg=colour238]#W #[fg=colour238,bg=colour234,nobold,nounderscore,noitalics]"
# Manual theme stuff
set -g status-interval 1
set -g window-style 'fg=#bcbcbc,bg=terminal'
set -g window-active-style 'fg=#ffffff,bg=#121212'
# Set background to a pane in copy mode
set-hook -g pane-mode-changed {
if -F "#{m/r:(copy|view)-mode,#{pane_mode}}" {
set -p window-style bg=#23231d
set -p window-active-style bg=#23231d
} {
set -pu window-style
set -pu window-active-style
}
}
###
### Key bindings are after options since the if-shell below apparently creates a client session
### earlier than expects and some options weren't being set.... or something...
###
# Smart pane switching with awareness of vim splits
%hidden prevent_select_pane="ps -o state= -o comm= -t \$(basename '#{pane_tty}') | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?(g?(view|n?vim?x?)(diff)?|fzf)\$'"
bind -n C-h if-shell "$prevent_select_pane" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$prevent_select_pane" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$prevent_select_pane" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$prevent_select_pane" "send-keys C-l" "select-pane -R"
bind -n C-x {
send-keys C-x
switch-client -T cee_ex
}
bind -T cee_ex Any send-keys
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
bind 'C-\' select-window -l
bind -r Up resize-pane -U 5
bind -r Down resize-pane -D 5
bind -r Left resize-pane -L 5
bind -r Right resize-pane -R 5
bind -r C-Up move-pane -s '{marked}' -v -b
bind -r C-Down move-pane -s '{marked}' -v
bind -r C-Left move-pane -s '{marked}' -h -b
bind -r C-Right move-pane -s '{marked}' -h
bind Space send-prefix
bind s split-window -vb -c '#{pane_current_path}'
bind v split-window -h -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
bind S split-window -vbf -c '#{pane_current_path}'
bind V split-window -hf -c '#{pane_current_path}'
unbind %
unbind '"'
bind w choose-session
bind W switch-client -l
bind C-w choose-session "kill-session -t '%%'"
bind X confirm-before -p "kill-window #W? (y/n)" kill-window
bind r source-file ~/.tmux.conf \; display "tmux config reloaded!"
bind Escape copy-mode
bind p paste-buffer
bind -T copy-mode-vi 'Space' send -X begin-selection
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'H' send -X start-of-line
bind -T copy-mode-vi 'L' send -X end-of-line
bind -T copy-mode-vi 'y' send -X copy-pipe "$COPY_CMD"
bind -T copy-mode-vi 'Y' {
send -X copy-pipe-and-cancel "$COPY_CMD"
paste-buffer -s ' '
}
bind -T copy-mode-vi 'D' send -X copy-pipe "xargs -I% open 'https://duckduckgo.com/?q=%'"
bind C-y run "tmux save-buffer - | ($COPY_CMD)"
bind -T copy-mode-vi [ send -X previous-prompt
bind -T copy-mode-vi ] send -X next-prompt
bind -Tcopy-mode-vi / { command-prompt -T search -p'(search down)' {
send -X search-forward '%%'
bind -T copy-mode-vi 'n' send -X search-again
bind -T copy-mode-vi 'N' send -X search-reverse
} }
bind -Tcopy-mode-vi ? { command-prompt -T search -p'(search up)' {
send -X search-backward '%%'
bind -T copy-mode-vi 'n' send -X search-reverse
bind -T copy-mode-vi 'N' send -X search-again
} }
bind / { copy-mode; send / }
bind < swap-window -t -1
bind > swap-window -t +1
bind , command-prompt "rename-window '%%'"
bind ` show-messages
bind = run-shell "~/.tmux/equalize-layout.js '#{window_layout}' | xargs tmux select-layout"
bind C-n run-shell -b "~/.tmux/noti-me.sh #{pane_pid}"