/
.tmux.conf
117 lines (95 loc) · 3.74 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
# Config stuff
# Fix truecolor.
set -ga terminal-overrides ",*256col*:Tc"
# Set window and pane indexes to start from 1 for conveniece.
set -g base-index 1
set -g renumber-windows on
set -gw pane-base-index 1
# Fix tmux always using bash in Linux
set -g default-shell /bin/zsh
# If this template resolves to something longer than the max length, the status
# line overwrites it. In order to fit the formatting around the session name
# (the brackets and the whitespace), it is limited to 12 characters.
set -g status-left '[#{=12:session_name}] '
set -g status-left-length 40
set -g status-right '#{?client_prefix,#[reverse]<Prefix>#[noreverse] ,}"#{=21:pane_title}" %H:%M %d-%b-%y'
# set -g status-bg colour51
# Remap prefix from 'C-b' to 'C-a'
set -g prefix C-a
unbind C-b
# Custom shortcuts
# When adding any bindings to the root table (triggerred without pressing
# prefix key), make sure to also add a prefix binding that sends the original
# key. This acts as an escape hatch in case any program uses the same keybinding.
# The sleep step is a workaround to a race condition ¯\_(ツ)_/¯
bind -n C-k send-keys C-l \; run "sleep 1" \; clear-history
bind C-k send-keys C-k
# Toggle synchronize pane TODO: Echo something to status bar
# TODO: maybe make this shortcut global?
bind C-x setw synchronize-panes
# Pane navigation with Alt-n
bind -n M-1 select-pane -t 1
bind -n M-2 select-pane -t 2
bind -n M-3 select-pane -t 3
bind -n M-4 select-pane -t 4
bind -n M-5 select-pane -t 5
bind -n M-6 select-pane -t 6
bind -n M-7 select-pane -t 7
bind -n M-8 select-pane -t 8
bind -n M-9 select-pane -t 9
bind M-1 send-keys M-1
bind M-2 send-keys M-2
bind M-3 send-keys M-3
bind M-4 send-keys M-4
bind M-5 send-keys M-5
bind M-6 send-keys M-6
bind M-7 send-keys M-7
bind M-8 send-keys M-8
bind M-9 send-keys M-9
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
# Plugins
# Override tmux-sensible settings
set -g display-time 1500
# tmux-sensible sets the default command to "reattach-to-user-namespace $SHELL"
# which causes tmux to briefly show reattach-to-user-namespace as the window
# title before it replaces itself with the shell process, resulting in
# status-bar jumping.
# To work around this, we set the default command to the shell, which is the
# default when the option is empty but in this case it is required to prevent
# tmux-sensible from overwriting it.
# This is only required on macOS.
# set -g default-command "$SHELL"
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g mouse on
set -g @scroll-speed-num-lines-per-scroll 1
set -g @emulate-scroll-for-no-mouse-alternate-buffer on
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @pane_resize 1
set -g @plugin 'kaykayehnn/tmux-pain-control'
# yarn.js is a workaround to properly detect yarn scripts
set -g @resurrect-processes 'autossh "~yarn.js start->yarn start" micro watch'
# Restore on tmux server start
set -g @resurrect-capture-pane-contents 'on'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @continuum-restore 'on'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'wfxr/tmux-fzf-url'
# Theme
set -g status-style fg=yellow
set -g window-status-style fg=brightblue
set -g window-status-current-style fg=brightred
set -gw pane-active-border-style fg=magenta
set -gw pane-border-style fg=brightblack
set -g message-style fg=brightred,bg=default
# This is the view trigger by prefix+q
set -g display-panes-colour yellow
set -g display-panes-active-colour magenta
set -g clock-mode-colour magenta
set -g window-status-bell-style fg=black,bg=red
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'