-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
88 lines (62 loc) · 2.88 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
set -g default-terminal "screen-256color"
set -g repeat-time 250
# Use Alt-arrow keys without prefix to resize panes
bind -r h resize-pane -L 5
bind -r l resize-pane -R 5
bind -r k resize-pane -U 5
bind -r j resize-pane -D 5
#Use m to toggle maximizing the current pane
bind -r m resize-pane -Z
# Use Shift-arrow without prefix to switch windows
bind -n M-] previous-window
bind -n M-] next-window
set -g status-left-length 40
set -g status-right-length 60
set -g status-position bottom
set -g status-fg white
set -g status-bg "colour234"
set -g status-left '#[fg=colour235,bg=colour252,bold] #S » #I #P '
set -g status-right '#[bg=colour252,fg=colour235,bold] %Y-%m-%d %H:%M:%S #[default]'
# split panes with different keybindings
unbind %
bind | split-window -h -c "#{pane_curent_path}"
unbind '"'
bind - split-window -v -c "#{pane_current_path}"
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
unbind -T copy-mode-vi MouseDragEnd1Pane
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# decide whether we're in a Vim process
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'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+'
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
bind-key -T copy-mode-vi 'C-\' select-pane -l
bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+
# tpm plugin (tmux plugin manager)
set -g @plugin 'tmux-plugins/tpm'
# navigation plugin
set -g @plugin 'christoomey/vim-tmux-navigator'
# get tmux sessions back after computer restart
set -g @plugin 'tmux-plugins/tmux-resurrect' # persist tmux sessions after computer restart
set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves sessions for you every 15 minutes
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/default/cyan'
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
# Initialize TMUX plugin manager (keep this line at the bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
set -s escape-time 0