-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
132 lines (97 loc) · 4.53 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
# List of plugins
set -g @plugin 'dracula/tmux'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# continuum options
set -g @continuum-restore 'on'
set -g @continuum-boot-options 'iterm'
set -g @resurrect-strategy-nvim 'session'
# dracula options
set -g @dracula-show-powerline false
set -g @dracula-show-left-icon session
set -g @dracula-show-flags false
set -g @dracula-cpu-usage-label ""
set -g @dracula-ram-usage-label ""
set -g @dracula-battery-label ""
set -g @dracula-plugins "cpu-usage ram-usage battery"
# resurrect options
set -g @resurrect-dir '~/.config/tmux/resurrect'
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
set -g @resurrect-capture-pane-contents 'on'
set -g status-right 'Continuum status: #{continuum_status}'
# -- general -------------------------------------------------------------------
term="alacritty"
set -g default-terminal "$term"
set -sa terminal-features ",$term:RGB"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
setw -g xterm-keys on
# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
set -sg repeat-time 600 # increase repeat timeout
# focus events enabled for terminals that support them
set -s focus-events on
# super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
set-option -g status-keys vi
set-option -g mode-keys vi
set-option -g mouse on
set-option -g prefix C-Space
# set only on OS X where it's required
# set -g default-command "reattach-to-user-namespace -l $SHELL"
bind / copy-mode \; send /
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
# Reload settings
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!"
# Open current directory
bind o run-shell "open #{pane_current_path}"
# increase scrollback buffer size
set -g history-limit 50000
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g automatic-rename-format '#{pane_current_command} #{b:pane_current_path}'
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# -- navigation ----------------------------------------------------------------
# split current window horizontally
bind h split-window -v
# split current window vertically
bind v split-window -h
# navigate window
bind -n C-n select-window -t +1
bind -n C-b select-window -t -1
# pane navigation
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
# pane resize
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1'
bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1'
bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1'
bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1'
bind-key -T copy-mode-vi M-h resize-pane -L 1
bind-key -T copy-mode-vi M-j resize-pane -D 1
bind-key -T copy-mode-vi M-k resize-pane -U 1
bind-key -T copy-mode-vi M-l resize-pane -R 1
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
setenv -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.config/tmux/plugins/"
if "test ! -d ~/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'"
run '~/.config/tmux/plugins/tpm/tpm'
# setw -g aggressive-resize off