-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_tmux.conf
115 lines (91 loc) · 3.94 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
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Escape mode is available to override everything bound with "bind -n"
bind Escape switch-client -T escape
bind -T escape C-left send-keys C-left \; switch-client -T escape
bind -T escape C-right send-keys C-right \; switch-client -T escape
bind -T escape C-down send-keys C-down \; switch-client -T escape
bind -T escape C-PageUp send-keys C-PageUp \; switch-client -T escape
bind -T escape C-PageDown send-keys C-PageDown \; switch-client -T escape
bind -n C-left previous-window
bind -n C-right next-window
bind -n C-PageUp swap-window -t -1
bind -n C-PageDown swap-window -t +1
bind -n C-down new-window
set -g visual-bell off # Disable annoying bells in .inputrc
set -g default-shell /usr/bin/fish
# credit for version-checking: https://stackoverflow.com/a/41392083
if-shell "tmux -V | awk '{exit !($2 >= \"3.3\")}'" \
"set -g allow-passthrough on" # required for hterm-notify
# Rebind pane selectors to have modifiers, so you can start using selected
# windows right away even if the first keystroke is an arrow. Note that
# these are bound without "-n", so you need the prefix (as opposed to window
# selectors).
unbind left
unbind right
unbind up
unbind down
bind -r C-left select-pane -L
bind -r C-right select-pane -R
bind -r C-up select-pane -U
bind -r C-down select-pane -D
bind -r S-left resize-pane -L
bind -r S-right resize-pane -R
bind -r S-up resize-pane -U
bind -r S-down resize-pane -D
set-option -g mode-keys vi
set-option -g mouse on
set-option -g set-clipboard on
# Credit: https://stackoverflow.com/questions/27307815/how-do-i-change-the-starting-directory-of-a-tmux-session/68838778#68838778
bind c attach-session -c "#{pane_current_path}" \; display-message "Session path is now #{pane_current_path}"
# Some settings copied shamelessly from http://github.com/davidbrewer/tmux-conf
# better mnemonics for splitting panes!
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
color_status_bg=colour234
color_status_current=colour23
color_battery=colour166
color_date=colour37
color_time=colour43
color_loadavg=colour31
color_inactive_title_fg=colour38
color_border=colour238
color_border_active=colour30
color_text_fg=colour7
# Terminal overrides - use ~/.bin/terminal-test to test
# Older setting for terminal-overrides, seems no longer necessary, conflicts with
# tui-cursor-tmux below
# https://superuser.com/questions/891336/fixed-highlighting-in-tmux
#set -g terminal-overrides '*:sitm@,ritm@,*-256color:Tc'
# https://neovim.io/doc/user/tui.html#tui-cursor-tmux
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
# screen-256color causes issues with "shift-right" and others. This appears to
# be the effective default in 3.3a and higher.
set -g default-terminal "tmux-256color"
set -g status-style fg=$color_text_fg,bg=$color_status_bg
set -g status on # Force-enable for Cloud Shell
set -g status-left '#h:#S '
set -g status-left-length 30
set -g status-right-length 100
set -g status-right "#{?#{!=:#{client_key_table},root},#{client_key_table},}#[fg=colour43]#(TMUX_STATUS_FG=colour43 ~/.tmux.conf.d/status-icons.sh)"
setw -g window-status-style fg=$color_inactive_title_fg,bg=$color_status_bg,dim
setw -g window-status-current-style fg=$color_text_fg,bg=$color_status_current,bright
set -g pane-border-style fg=$color_border,bg=default
set -g pane-active-border-style fg=$color_border_active,bg=default
setw -g monitor-activity on
# Don't forget, you can monitor-silence as well.
set -g renumber-windows on
# From https://github.com/samoshkin/tmux-config#nested-tmux-sessions
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set window-status-current-style fg=$color_inactive_title_fg,bg=$color_status_bg,dim \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u window-status-current-style \;\
set -u window-status-current-format \;\
refresh-client -S