-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
55 lines (43 loc) · 1.5 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
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# split panes with | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# window resize
bind-key -r -T prefix C-h resize-pane -L
bind-key -r -T prefix C-j resize-pane -D
bind-key -r -T prefix C-k resize-pane -U
bind-key -r -T prefix C-l resize-pane -R
# smart pane-switching (Alt + HJKL)
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
# disable escape key as meta key
set -s escape-time 0
# customize appearance
set -g default-terminal "screen-256color"
# vim compatibility
set-window-option -q -g utf8 on
set-window-option -g mode-keys vi
# reload config file with prefix + r
bind r source-file ~/.tmux.conf
# disable automatic window renaming
set-option -g allow-rename off
# scroll back size
set -g history-limit 50000
# local settings
if "test -f ~/.tmux.conf.local" \
"source-file ~/.tmux.conf.local"
# tmux plugin manager settings
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'jimeh/tmux-themepack'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'