-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
executable file
·90 lines (69 loc) · 3.22 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
# https://juliu.is/a-simple-tmux/
set -g mouse on
set -g history-limit 102400
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g default-terminal 'screen-256color'
set-option -g default-shell /bin/zsh
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Fix ESC delay in vim
set -g escape-time 10
unbind C-b
set -g prefix C-a
bind C-a send-prefix
unbind-key -T copy-mode-vi v
bind-key -T copy-mode-vi v \
send-keys -X begin-selection
bind-key -T copy-mode-vi 'C-v' \
send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y \
send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane \
send-keys -X copy-pipe-and-cancel "pbcopy"
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
bind c new-window -c '#{pane_current_path}'
bind '\' split-window -h -c '#{pane_current_path}'
bind s split-window -v -c '#{pane_current_path}'
bind b last-window
# VIM movement
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-h' select-pane -L
bind-key -n 'C-j' select-pane -D
bind-key -n 'C-k' select-pane -U
bind-key -n 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
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
set-option -g status-justify left
set-option -g status-left '#[bg=colour72] #[bg=colour237] #[bg=colour236] #[bg=colour235]#[fg=colour185] #S #[bg=colour236] '
set-option -g status-left-length 16
set-option -g status-bg colour237
set-option -g status-right '#[bg=colour236] #[bg=colour235]#[fg=colour185] %a %R #[bg=colour236]#[fg=colour3] #[bg=colour237] #[bg=colour72] #[]'
set-option -g status-interval 60
set-option -g pane-active-border-style fg=colour246
set-option -g pane-border-style fg=colour238
set-window-option -g window-status-format '#[bg=colour238]#[fg=colour107] #I #[bg=colour239]#[fg=colour110] #[bg=colour240]#W#[bg=colour239]#[fg=colour195]#F#[bg=colour238] '
set-window-option -g window-status-current-format '#[bg=colour236]#[fg=colour215] #I #[bg=colour235]#[fg=colour167] #[bg=colour234]#W#[bg=colour235]#[fg=colour195]#F#[bg=colour236] '
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# scrolling
#bind-key -T vi-copy WheelUpPane scroll-up
#bind-key -T vi-copy WheelDownPane scroll-down
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# run '~/.tmux/plugins/tpm/tpm'