/
.tmux.conf
89 lines (73 loc) · 3.04 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
## Prefix like in screen
set -g prefix 'C-a'
## Use xterm keys (makes eg. Ctrl+Arrow navigate words)
set-window-option -g xterm-keys on
## List of plugins
# For this to work you need to install https://github.com/tmux-plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Those two allow continuous saving and restoring of tmux sessions
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Intuitive bindings for splitting panes
set -g @plugin 'tmux-plugins/tmux-pain-control'
# Integrations with system clipboard
set -g @plugin 'tmux-plugins/tmux-yank'
# Easier session management
set -g @plugin 'tmux-plugins/tmux-sessionist'
# Man in a split
set -g @plugin 'knakayama/tmux-man'
# Peek-a-boo
set -g @plugin 'knakayama/tmux-newline-detector'
## Plugin configuration
set -g @continuum-restore 'on'
set -g @continuum-save-interval '5'
set -g @resurrect-capture-pane-contents 'on'
set -g @yank_selection 'primary'
set -g @man-size '40%'
set -g @man-orientation 'h'
set -g @man-shell-interactive 'off'
# True colors (via: https://jdhao.github.io/2018/10/19/tmux_nvim_true_color/ )
set -g default-terminal "screen-256color"
# tell Tmux that outside terminal supports true color
set -ag terminal-overrides ",alacritty:RGB"
## Windows style
set-option -g status-style fg=yellow,bg=default
set-window-option -g pane-active-border-style ''
## A bit more space in right status bar
set -g status-right-length 50
## Rename windows to fit current application
setw -g automatic-rename on
# Use zsh regardless of default settings
if-shell 'test -x /usr/bin/zsh' 'set-option -g default-shell /usr/bin/zsh'
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
## Mouse On by default
set -g mouse on
# PageUp/PageDown works for scrolling
bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
bind-key -T copy-mode-vi PPage send-keys -X page-up
bind-key -T copy-mode-vi NPage send-keys -X page-down
# Same for the mouse scroll button
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
# Toggle prefix on/off with F12 (for nested remote sessions)
bind -T root F12 \
set prefix None \;\
set key-table off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
refresh-client -S
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
# vim: se ft=tmux :