Xinqi Bao's Git

vimrc: new plugin, majutsushi/tagbar, airblade/vim-gitgutter
[dotfiles.git] / .tmux.conf
1 # Improve colours
2 set -g default-terminal 'xterm-256color'
3
4 # Set scrollback buffer to 10000
5 set -g history-limit 10000
6
7 # when turned on, would cause issue at copy mode in gitBash
8 set -g mouse off
9
10 # remap prefix from 'C-b' to 'C-a'
11 unbind C-b
12 set-option -g prefix C-a
13 bind-key C-a send-prefix
14
15 # split panes using | and -
16 bind c new-window -c $HOME
17 bind | split-window -h -c "#{pane_current_path}"
18 bind - split-window -v -c "#{pane_current_path}"
19 bind-key C-a last-window
20 unbind '"'
21 unbind %
22
23 ## Status bar design
24 # status line
25 set -g status-justify left
26 set -g status-interval 2
27
28 # loud or quiet?
29 set-option -g visual-activity off
30 set-option -g visual-bell off
31 set-option -g visual-silence off
32 set-window-option -g monitor-activity off
33 set-option -g bell-action none
34
35
36 # The modes {
37 setw -g clock-mode-colour colour135
38 setw -g mode-style fg=colour196,bg=colour238,bold
39 # }
40
41
42 # The panes {
43 set -g pane-border-style fg=colour238,bg=colour235
44 set -g pane-active-border-style fg=colour51,bg=colour236
45 # }
46
47
48 # The statusbar {
49 set -g status-position bottom
50 set -g status-style fg=colour137,bg=colour234,dim
51
52 set -g status-left ''
53 set -g status-left-length 20
54
55 set -g status-right '#[fg=colour233,bg=colour245,bold] %H:%M #[fg=colour233,bg=colour253,bold] %m-%d '
56 set -g status-right-length 50
57
58 setw -g window-status-current-style fg=colour69,bg=colour253,bold
59 setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour233]#W#[fg=colour69]#F '
60
61 setw -g window-status-style fg=colour131,bg=colour245,none
62 setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour233]#W#[fg=colour131]#F '
63
64 setw -g window-status-bell-style fg=colour255,bg=colour1,bold
65 # }
66
67
68 # The messages {
69 set -g message-style fg=colour232,bg=colour166,bold
70 set -g message-command-style fg=blue,bg=black
71 # }
72
73 # Smart pane switching with awareness of Vim splits.
74 # See: https://github.com/christoomey/vim-tmux-navigator{
75 is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
76 | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
77 bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
78 bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
79 bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
80 bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
81 tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
82 if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
83 "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
84 if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
85 "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
86
87 bind-key -T copy-mode-vi 'C-h' select-pane -L
88 bind-key -T copy-mode-vi 'C-j' select-pane -D
89 bind-key -T copy-mode-vi 'C-k' select-pane -U
90 bind-key -T copy-mode-vi 'C-l' select-pane -R
91 bind-key -T copy-mode-vi 'C-\' select-pane -l
92 # }
93
94 #enable powerline for tmux
95 #source /usr/lib/python3.8/site-packages/powerline/bindings/tmux/powerline.conf