-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_tmux.conf
192 lines (155 loc) · 5.68 KB
/
dot_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
# vim: set filetype=tmux foldmethod=marker :
# {{{ block: terminal
set -g default-terminal "tmux-256color"
# OSC 8, RGB
set -ga terminal-features ",*:hyperlinks,*:RGB"
# block: terminal }}}
# remap prefix
set -g prefix C-a
# enable mouse support
set -g mouse on
# start windows and panes at 1, not 0
set -g base-index 1
set -gw pane-base-index 1
# sync windows number on create/destroy
set -g renumber-windows on
# vi mode keys for navigation
set -gw mode-keys vi
# toggle synchronize-panes
bind C-x set -w synchronize-panes
# copy-mode begin-selection with v
bind -T copy-mode-vi v send-keys -X begin-selection
# copy-mode prompt jump
bind -T copy-mode-vi ] send-keys -X next-prompt
bind -T copy-mode-vi [ send-keys -X previous-prompt
# create new window
bind c new-window -c "#{pane_current_path}"
# toggle status line
bind -Troot C-F12 set status
bind -Tsuspended C-F12 set status
# navigate across tmux-vim
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -Troot C-w if-shell "$is_vim" "send-keys C-w" "switch-client -Tnav; refresh-client -S"
bind -Tnav C-w send-keys 'C-w'
# {{{ keybinds: select-pane
bind -Tnav h select-pane -L
bind h select-pane -L
bind -Tnav C-h select-pane -L
bind C-h select-pane -L
bind -Tnav j select-pane -D
bind j select-pane -D
bind -Tnav C-j select-pane -D
bind C-j select-pane -D
bind -Tnav k select-pane -U
bind k select-pane -U
bind -Tnav C-k select-pane -U
bind C-k select-pane -U
bind -Tnav l select-pane -R
bind l select-pane -R
bind -Tnav C-l select-pane -R
bind C-l select-pane -R
# keybinds: select-pane }}}
# {{{ keybinds: split-window
bind -Tnav "\\" split-window -h -c "#{pane_current_path}" # vertical
bind "\\" split-window -h -c "#{pane_current_path}" # vertical
bind -Tnav "|" split-window -fh -c "#{pane_current_path}" # full vertical
bind "|" split-window -fh -c "#{pane_current_path}" # full vertical
bind -Tnav "-" split-window -v -c "#{pane_current_path}" # horizontal
bind "-" split-window -v -c "#{pane_current_path}" # horizontal
bind -Tnav "_" split-window -fv -c "#{pane_current_path}" # full horizontal
bind "_" split-window -fv -c "#{pane_current_path}" # full horizontal
# keybinds: split-window }}}
# {{{ keybinds: resize-pane
bind -r -Tnav M-h resize-pane -L 10
bind -r M-h resize-pane -L 10
bind -r -Tnav M-j resize-pane -D 5
bind -r M-j resize-pane -D 5
bind -r -Tnav M-k resize-pane -U 5
bind -r M-k resize-pane -U 5
bind -r -Tnav M-l resize-pane -R 10
bind -r M-l resize-pane -R 10
# keybinds: resize-pane }}}
# {{{ keybinds: swap-window
bind -r "<" swap-window -d -t -1
bind -r ">" swap-window -d -t +1
# keybinds: swap-window }}}
# {{{ keybinds: mouse
bind -Troot MouseDown1Status if -F '#{==:#{mouse_status_range},window}' {
select-window
} {
if -F '#{==:#{mouse_status_range},switch_session}' {
if 'test "$(tmux list-session | wc -l)" -eq 1' {
new-session -Ads 1
}
switch-client -n
}
}
# keybinds: mouse }}}
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-cowboy'
# {{{ plugin: tmux-yank
set -g @yank_action 'copy-pipe'
set -g @plugin 'tmux-plugins/tmux-yank'
# plugin: tmux-yank }}}
# {{{ plugin: tmux-thumbs
set -g @thumbs-unique yes
set -g @thumbs-command 'tmux set-buffer {} && echo -n {} | xsel -i --clipboard'
set -g @thumbs-upcase-command 'tmux set-buffer {} && echo -n {} | xsel -i && tmux paste-buffer'
set -g @plugin 'fcsonline/tmux-thumbs'
# plugin: tmux-thumbs }}}
# {{{ block: appearance
set -gw clock-mode-colour "blue"
set -gw pane-active-border-style "fg=magenta"
set -gw pane-border-style "fg=brightblack"
set -gw window-status-activity-style "fg=blue"
set -gw window-status-bell-style "fg=yellow"
set -gw window-status-current-format " #F#I:#W "
set -gw window-status-current-style "fg=green,reverse"
set -gw window-status-format " #F#I:#W "
set -gw window-status-last-style "fg=green"
set -gw window-status-separator ""
set -gw window-status-style ""
set -g display-panes-active-colour "magenta"
set -g display-panes-colour "brightblack"
set -g message-command-style ""
set -g message-style ""
set -g status-left "#[range=user|switch_session] #S #[norange]"
set -g status-left-style "fg=blue bold reverse"
set -g status-right "%Y-%m-%d %H:%M #{tmux_mode_indicator}"
set -g status-style ""
# {{{ plugin: tmux-mode-indicator
set -g @mode_indicator_prefix_mode_style "fg=blue,reverse"
set -g @mode_indicator_copy_mode_style "fg=yellow,reverse"
set -g @mode_indicator_sync_mode_style "fg=brightred,reverse"
set -g @mode_indicator_empty_mode_style "fg=cyan,reverse"
set -g @plugin 'MunifTanjim/tmux-mode-indicator'
# plugin: tmux-mode-indicator }}}
# block: appearance }}}
# {{{ plugin: tmux-suspend
set -g @suspend_suspended_options " \
status-left-style::bg=black\\,fg=brightblack bold, \
status-right-style::fg=brightblack, \
window-status-current-style:gw:fg=brightblack\\,reverse, \
window-status-last-style:gw:fg=brightblack, \
window-status-style:gw:fg=brightblack, \
@mode_indicator_custom_prompt:: ---- , \
@mode_indicator_custom_mode_style::fg=brightblack\\,reverse, \
"
set -g @plugin 'MunifTanjim/tmux-suspend'
# plugin: tmux-suspend }}}
# {{{ ssh
# if-shell 'test -n "$SSH_CLIENT" -o -n "$SSH_TTY"' {
# ssh specific config goes here
# }
# ssh }}}
# {{{ tpm
set-environment -g TMUX_PLUGIN_MANAGER_PATH "${HOME}/.tmux/plugins"
# setup automagically
if-shell 'test ! -d ~/.tmux/plugins/tpm' "run-shell '\
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && \
~/.tmux/plugins/tpm/bin/install_plugins'"
# initialize
run-shell -b '~/.tmux/plugins/tpm/tpm'
# tpm }}}