-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
233 lines (186 loc) · 8.23 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
# Automatically install TPM if not already installed.
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'"
# TPM plugins.
## Press Ctrl-a-I to install new plugins.
## Press Ctrl-a-u to uninstall plugins.
## Press Ctrl-a-U to update plugins.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
#set -g @plugin 'thewtex/tmux-mem-cpu-load'
set -g @plugin 'RedBug312/tmux-concentrate'
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
set -g @plugin 'tmux-plugins/tmux-logging'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# set -g @plugin 'erikw/tmux-powerline'
# set -g @plugin 'maxattax97/tmux-powerline'
set -g @plugin 'akohlbecker/aw-watcher-tmux'
# Plugin configuration.
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-boot 'off'
set -g @continuum-restore 'off'
set -g @prefix_highlight_fg 'colour255'
set -g @prefix_highlight_bg 'colour033'
set -g @prefix_highlight_output_prefix '#[fg=colour249]#[bg=colour033]#[fg=colour255] '
set -g @prefix_highlight_output_suffix ' #[fg=colour033]#[bg=colour234]'
set -g @prefix_highlight_empty_prompt '#[fg=colour249]#[bg=colour234] '
set -g @concentrate-key g
set -g @net_speed_format "#[fg=colour214]D %10s #[fg=colour033]U %10s#[fg=default]"
set -g @sysstat_cpu_color_low "colour046"
set -g @sysstat_cpu_color_medium "colour033"
set -g @sysstat_cpu_color_stress "colour196"
set -g @sysstat_mem_color_low "colour046"
set -g @sysstat_mem_color_medium "colour033"
set -g @sysstat_mem_color_stress "colour196"
set -g @sysstat_swap_color_low "colour046"
set -g @sysstat_swap_color_medium "colour033"
set -g @sysstat_swap_color_stress "colour196"
set -g @sysstat_cpu_view_tmpl '#[fg=colour255]C #[fg=#{cpu.color}]#{cpu.pused}'
set -g @sysstat_mem_view_tmpl '#[fg=colour255]M #[fg=#{mem.color}]#{mem.pused}'
set -g @sysstat_swap_view_tmpl '#[fg=colour255]S #[fg=#{swap.color}]#{swap.pused}'
set -g @batt_charged_icon ""
set -g @batt_charging_icon ""
set -g @batt_attached_icon ""
set -g @batt_full_charge_icon ""
set -g @batt_high_charge_icon ""
set -g @batt_medium_charge_icon ""
set -g @batt_low_charge_icon ""
set -g @batt_color_full_charge "#[fg=default]"
set -g @batt_color_high_charge "#[fg=colour046]"
set -g @batt_color_medium_charge "#[fg=colour214]"
set -g @batt_color_low_charge "#[fg=colour196]"
set -g @batt_color_charging "#[fg=colour033]"
set -g @net_speed_format " %8s %8s"
## Copy paste settings
## https://github.com/tmux/tmux/wiki/Clipboard
set -g mode-keys vi
set -g set-clipboard external
set -s copy-command 'xsel -i --clipboard'
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-pipe
bind -T copy-mode C-c send -X copy-pipe-no-clear
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear
# Sensible: Fix the colors.
#set -g default-terminal "xterm-256color"
#set -g default-terminal "xterm-256color-italic"
#set -ga terminal-overrides ",xterm-256color:Tc"
set-option -ga terminal-overrides ",xterm-256color:Tc,rxvt-unicode-256color:Tc,screen-256color:Tc"
# Bind to Ctrl-a instead of Ctrl-b since Vim uses it.
set-option -g prefix C-a
# Use zsh by default.
#set-option -g default-shell /bin/zsh
# Instead of doing this, rely on $SHELL. It's BSD friendly.
# Key bindings.
bind-key v split-window -h -c "#{pane_current_path}"
bind-key b split-window -c "#{pane_current_path}"
## Resize with Alt-arrow.
## NOTE: Conflicts with Weechat!
#bind -n M-up resize-pane -U 1
#bind -n M-down resize-pane -D 1
#bind -n M-left resize-pane -L 1
#bind -n M-right resize-pane -R 1
#bind -n M-k resize-pane -U 3
#bind -n M-j resize-pane -D 3
#bind -n M-h resize-pane -L 3
#bind -n M-l resize-pane -R 3
## Slide windows left or right.
## For some reason this has caused a lot of strife despite versions being the
## same. On the BATS Laptop you need to switch the window after swapping, on my
## desktop this is unnecessary.
bind C-p swap-window -t -1 \; previous-window
bind C-n swap-window -t +1 \; next-window
## Allows us to use C-a a <command> to send commands to a TMUX session inside
## another TMUX session.
bind-key C-a send-prefix
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
## Reload configuration.
bind r source-file ~/.tmux.conf \; display-message "Configuration reloaded."
## Enable mouse.
set -g mouse on
## Allow mouse toggling for things like copy paste.
bind m set -g mouse on \; display-message "Mouse enabled."
bind M set -g mouse off \; display-message "Mouse disabled."
## "Lock" the session
bind C-L lock-session
# Various comfort settings.
## Automatic window rename.
set -g allow-rename on
set -g automatic-rename on
set -g renumber-windows on
## Sensible: 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.
# set -g aggressive-resize on
## Activity monitoring
set -g monitor-activity off # Only for bell.
set -g visual-activity off # Disables annoying updates on htop?
set -g display-time 1500
## Sets terminal titles.
set -g set-titles on
set -g bell-action none
## Start windows and panes at 1 instead of 0 (for Ctrl-a 1 jump).
set -g base-index 1
set -g pane-base-index 1
## Sensible: Reduce the escape time to 0, fixes vim mode switching delay.
## Also from Neovim :CheckHealth
set -sg escape-time 10
## Neovim :CheckHealth says I should have this on.
set -g focus-events on
## Powerline.
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# Remove mouse mode fail.
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\)' 'set -g mouse off'
# Solarized color scheme.
set-option -g status-style "fg=colour255 bg=colour234"
## Default window title colors.
set-option -g window-status-style "fg=colour255 bg=colour236 dim"
## Active and alert window title colors.
set-option -g window-status-current-style "fg=colour033 bg=colour232"
set-option -g window-status-bell-style "fg=colour196 bg=default"
## Pane border.
set-option -g pane-border-style "fg=colour008"
set-option -g pane-active-border-style "fg=colour015"
## Message text.
set-option -g message-style "fg=colour214 bg=colour234"
## Pane number display.
set-option -g display-panes-active-colour colour196
set-option -g display-panes-colour colour214
## Window modes.
set-option -g mode-style "fg=colour015 bg=colour008"
## Clock.
# set-option -g clock-mode-colour '#859900' #green
set-option -g clock-mode-colour colour255
set-option -g clock-mode-style 24
## Locking.
#if-shell '[ -x "$(command -v tmatrix)" ]' 'set-option -g lock-after-time 300'
## This appears to cause the tmux-server to crash on my BATS Laptop.
#if-shell '[ -x "$(command -v tmatrix)" ]' 'set-option -g lock-command "/usr/bin/tmatrix -C blue --title=\"M A X A T T A X\""'
## Alignment.
set -g status-interval 5
### Center align window list.
set -g status-justify centre
set -g status-left-length 128
set -g status-right-length 256
set-option -g status-position top
## Status bar formatting.
set -g status-left '#[fg=colour232]#[bg=colour255] #H:#S #[fg=colour255]#[bg=colour249]\
#[fg=colour232]#[bg=colour249] #(cat ~/.tmux.sh | sh -s _ip_address) #{prefix_highlight}\
#[default]'
set -g status-right '#[default]\
#[fg=colour249]#[fg=colour232]#[bg=colour249] %H:%M:%S %m-%d-%y'
set-option -g window-status-format ' #I #W #F '
set-option -g window-status-current-format '#[fg=colour234] #[fg=colour033]#I #W #F #[fg=colour234]'
# Install TPM if it is not installed.
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Must remain at bottom to kick off TPM.
run -b '$HOME/.tmux/plugins/tpm/tpm'