-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
216 lines (171 loc) · 7.55 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
### Key bindings
source-file ~/.tmux.conf.d/tmux.conf.local.pre
#set-option -g prefix C-a
#unbind C-b
#bind-key C-a send-prefix
#set-option -g default-terminal "screen-256color"
bind-key M-h pipe-pane -o 'cat >>~/tmux.#I-#P' \; display-message "Pipe current pane to ~/tmux.#I-#P"
bind-key S set-option synchronize-panes \; display-message "Synchronize-panes #{?synchronize-panes,ON,OFF}"
bind-key M-l lock-session
bind-key R source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
## duplicated with %
# bind-key | split-window -h
bind-key & command-prompt "join-pane -s '%%'"
## duplicated with !
#bind-key x confirm-before -p "break current pane of window #W@#S into a new window? (y/n)" break-pane
bind-key M-x confirm-before -p "kill-window #W@#S? (y/n)" kill-window
bind-key C-x command-prompt "swap-window -t '%%'"
## Select window
#bind-key C-b next-window
## Select pane
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key M-0 select-pane -t 0
bind-key M-1 select-pane -t 1
bind-key M-2 select-pane -t 2
bind-key M-3 select-pane -t 3
bind-key M-4 select-pane -t 4
bind-key M-5 select-pane -t 5
bind-key M-6 select-pane -t 6
bind-key M-7 select-pane -t 7
bind-key M-8 select-pane -t 8
bind-key M-9 select-pane -t 9
bind-key M-q select-layout even-horizontal
bind-key M-w select-layout even-vertical
bind-key M-e select-layout main-horizontal
bind-key M-r select-layout main-vertical
bind-key M-t select-layout tiled
## Resize pane size
bind-key H resize-pane -L 1
#bind-key M-Left resize-pane -L 1
bind-key J resize-pane -D 1
#bind-key M-Down resize-pane -D 1
bind-key K resize-pane -U 1
#bind-key M-Up resize-pane -U 1
bind-key L resize-pane -R 1
#bind-key M-Right resize-pane -R 1
bind-key C-h resize-pane -L 5
bind-key C-j resize-pane -D 5
bind-key C-k resize-pane -U 5
bind-key C-l resize-pane -R 5
## Toggle mouse
bind-key M set-option mouse \; display-message "Turn #{?mouse,ON,OFF} mouse support"
# To override the default 'bind-key ? list-keys -N'
bind-key ? list-keys
### Options
set-option -g other-pane-width 132
set-option -g mode-keys vi
#set-option -g mouse on
set-option -g lock-command vlock
### Color
#set-option -g window-style "bg=brightblack"
set-option -g window-style "bg=#3a3a3a"
set-option -g window-active-style "bg=black"
### Status line
set-option -g status-bg "#aaffff"
set-option -g status-fg "#222222"
set-option -g status-justify centre
set-option -g status-interval 1
#set-option -g status-left '#[fg=cyan][#[bg=yellow,fg=cyan]#S#[fg=cyan]]'
set-option -g status-left-length 20
#set-option -gw window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
#set-option -gw window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=colour230]#W#[fg=dim]#F'
set-option -g window-status-style "bg=#aaffff"
set-option -g window-status-current-style "bg=#00ffff,fg=#000000 bold"
set-option -g window-status-last-style "bg=#00ffff"
#set-option -g status-right '#[fg=cyan][#[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default] #($HOME/bin/battery)#[fg=cyan]]'
#set-option -g status-right '#{battery_status_bg} Batt: #{battery_icon} #{battery_percentage} #{battery_remain} | #[reverse,blink]#{?pane_synchronized,*** PANES SYNCED! ***,}#[default]#[fg=default]%Y-%m-%d %H:%M:%S#[default] #{tmux_mode_indicator}'
#set-option -g status-right '#{battery_status_bg} Batt: #{battery_icon} #{battery_percentage} #{battery_remain} | #[fg=default]%Y-%m-%d %H:%M:%S#[default] #{tmux_mode_indicator}'
set-option -g status-right '#[fg=default]%Y-%m-%d %H:%M:%S#[default] #{tmux_mode_indicator}'
set-option -g status-right-length 120
#bind-key [ copy-mode
#bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
#bind-key -T copy-mode-vi 'y' send-keys -X copy-selection
#bind-key -T copy-mode-vi 'V' send-keys -X rectangle-toggle
#bind-key ] paste-buffer
set-option -g display-time 5000
set-option -g history-limit 5000
set-option -g lock-command vlock
set-option -g lock-after-time 0 # Seconds; 0 = never
#bind l lock-client
#bind L lock-session
set-option -g @plugin 'tmux-plugins/tpm'
set-option -g @plugin 'tmux-plugins/tmux-sensible'
## to fix the FUCKING tmux-sensible setting
set -g default-terminal "xterm-256color"
set-option -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-processes 'ssh mysql psql sqlite3 watch'
# for vim
set -g @resurrect-strategy-vim 'session'
set-option -g @plugin 'tmux-plugins/tmux-continuum'
#set-option -g @plugin 'b0o/tmux-autoreload'
#set-option -g @tmux-autoreload-entrypoints '~/.tmux.conf'
#set-option -g @tmux-autoreload-configs '~/.tmux.conf,~/.tmux.conf.local'
#set-option -g @plugin 'ofirgall/tmux-browser'
#set-option -g @new_browser_window '/Applications/Firefox.app/Contents/MacOS/firefox'
set-option -g @plugin 'tmux-plugins/tmux-fpp'
set-option -g @fpp-bind off
bind-key O run-shell '~/.tmux/plugins/tmux-fpp start edit'
bind-key P run-shell '~/.tmux/plugins/tmux-fpp start paste'
### Copycat
# prefix + ctrl-f - simple file search
# prefix + ctrl-g - jumping over git status files (best used after git status command)
# prefix + alt-h - jumping over SHA-1/SHA-256 hashes (best used after git log command)
# prefix + ctrl-u - url search (http, ftp and git urls)
# prefix + ctrl-d - number search (mnemonic d, as digit)
# prefix + alt-i - ip address search
# then
# n - jumps to the next match
# # N - jumps to the previous match
# P - jumps to the previous match (overrides default copycat binding)
set-option -g @plugin 'tmux-plugins/tmux-copycat'
set-option -g @copycat_prev 'P'
set-option -g @copycat_search 'vim'
## When using iTerm2, you can disablethe following option and configure iTerm
# If you have tmux 1.5 or newer and are using iTerm2 version 3 or newer then the y in copy-mode and mouse selection will work without tmux-yank.
# To enable this:
# 1. Go into iTerm2's preferences.
# 2. Go to the "General" tab.
# 3. Check "Applications in terminal may access clipboard"
# 4. In tmux, ensure set-clipboard is turned on:
# ```
# $ tmux show-options -g -s set-clipboard
# set-clipboard on
# ```
#set-option -g @plugin 'tmux-plugins/tmux-yank'
#set-option -g default-command "reattach-to-user-namespace -l zsh"
set-option -g @plugin 'tmux-plugins/tmux-urlview'
set-option -g @plugin 'jaclu/tmux-menus'
set-option -g @menus_trigger '`'
set-option -g @menus_location_x 'C'
set-option -g @menus_location_y 'C'
##
# key bindings:
# - prefix + Tab - toggle sidebar with a directory tree
# - prefix + Backspace - toggle sidebar and move cursor to it (focus it)
set-option -g @plugin 'tmux-plugins/tmux-sidebar'
set-option -g @plugin 'MunifTanjim/tmux-mode-indicator'
set-option -g @plugin 'MunifTanjim/tmux-suspend'
set -g @suspend_suspended_options " \
status-bg::brightblack, \
status-left-style::fg=black bold dim, \
status-right-style::fg=black bold dim, \
window-status-current-style:gw:bg=black\\,fg=brightblack bold, \
window-status-last-style:gw:bg=brightblack\\,fg=black, \
window-status-style:gw:bg=brightblack\\,fg=black, \
@mode_indicator_custom_prompt:: ---- , \
@mode_indicator_custom_mode_style::bg=brightblack\\,fg=black, \
"
#set-option -g @plugin 'tmux-plugins/tmux-prefix-highlight'
#set -g @plugin 'tmux-plugins/tmux-battery'
#set -g @plugin 'erikw/tmux-powerline'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# source-file ~/.tmux.conf.d/tmux.style.conf
source-file ~/.tmux.conf.d/tmux.conf.local.post
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'