|
1 | 1 | # General ################################################################## |
2 | 2 | set -g mouse on |
3 | | - |
4 | | -# utf8 is on |
5 | | -set -g utf8 on |
6 | | -set -g status-utf8 on |
7 | | - |
8 | | -# address vim mode switching delay (http://superuser.com/a/252717/65504) |
9 | | -set -s escape-time 0 |
10 | | - |
11 | | -# increase scrollback buffer size |
12 | | -set -g history-limit 50000 |
13 | | - |
14 | | -# tmux messages are displayed for 4 seconds |
15 | | -set -g display-time 4000 |
16 | | - |
17 | | -# refresh 'status-left' and 'status-right' more often |
| 3 | +set -s escape-time 0 # address vim mode switching delay |
| 4 | +set -g history-limit 50000 # increase scrollback buffer size |
18 | 5 | set -g status-interval 5 |
19 | | - |
20 | | -# upgrade $TERM |
21 | 6 | set -g default-terminal "screen-256color" |
22 | | - |
23 | | -# vi keybinding |
24 | | -set -g mode-keys vi |
25 | | - |
26 | | -# focus events enabled for terminals that support them |
27 | | -set -g focus-events on |
28 | | - |
29 | | -# super useful when using "grouped sessions" and multi-monitor setup |
30 | | -setw -g aggressive-resize on |
| 7 | +set -g mode-keys vi # vi keybinding |
| 8 | +set -g focus-events on # focus events enabled for terminals that support them |
| 9 | +setw -g aggressive-resize on # super useful when using "grouped sessions" and multi-monitor setup |
31 | 10 |
|
32 | 11 | # change default prefix key |
33 | 12 | set -g prefix C-a |
34 | 13 | unbind C-b |
35 | 14 | bind C-a send-prefix |
36 | 15 |
|
37 | | -set -g base-index 1 # start windows numbering at 1 |
38 | | -setw -g pane-base-index 1 # make pane numbering consistent with windows |
39 | | -set -g renumber-windows on # renumber windows when a window is closed |
| 16 | +set -g base-index 1 # start windows numbering at 1 |
| 17 | +setw -g pane-base-index 1 # make pane numbering consistent with windows |
| 18 | +set -g renumber-windows on # renumber windows when a window is closed |
40 | 19 |
|
| 20 | +# vim keybinding |
41 | 21 | bind / copy-mode \; send-key ? |
42 | 22 | bind-key -T copy-mode-vi v send-keys -X begin-selection |
43 | 23 | bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel |
44 | 24 | bind-key -T copy-mode-vi C-w send-keys b \; send -X begin-selection \; send-keys E |
45 | | -bind-key -T copy-mode-vi C-shift-c send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard" |
46 | | - |
47 | | -bind l choose-tree # list and choose sessions |
| 25 | +bind-key -T copy-mode-vi C-c send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard" |
48 | 26 |
|
49 | | -# bind key to toggle mouse |
| 27 | +bind l choose-session |
50 | 28 | bind m set -g mouse \; display "Mouse #{?mouse,on,off}" |
51 | | - |
52 | | -# reload config |
53 | 29 | bind r source-file ~/.tmux.conf \; display "tmux.conf reloaded." |
54 | | - |
55 | | -# fullscreen |
56 | 30 | bind f resize-pane -Z |
57 | | - |
58 | | -# split windows like vim |
59 | 31 | bind v split-window -h -c "#{pane_current_path}" |
60 | 32 | bind s split-window -v -c "#{pane_current_path}" |
61 | | - |
62 | | -bind > swap-pane -D # swap current pane with the next one |
63 | | -bind < swap-pane -U # swap current pane with the previous one |
64 | | - |
65 | | -# pane resizing |
| 33 | +bind > swap-pane -D |
| 34 | +bind < swap-pane -U |
66 | 35 | bind -r H resize-pane -L 4 |
67 | 36 | bind -r J resize-pane -D 4 |
68 | 37 | bind -r K resize-pane -U 4 |
69 | 38 | bind -r L resize-pane -R 4 |
| 39 | +bind C-p previous-window |
| 40 | +bind C-n next-window |
70 | 41 |
|
71 | 42 | # Open small terminal :D |
72 | 43 | bind T split-window -l 15 -c "#{pane_current_path}" \; display "Create terminal" |
73 | 44 | bind t resize-pane -t 1 -Z |
74 | 45 |
|
75 | | -# Vim Tmux navigator |
76 | | -# see: https://github.com/christoomey/vim-tmux-navigator |
77 | 46 | is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ |
78 | | - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" |
| 47 | + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" |
79 | 48 | bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" |
80 | 49 | bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" |
81 | 50 | bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" |
82 | 51 | bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" |
83 | | -bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" |
| 52 | +bind -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l" |
84 | 53 | bind-key -T copy-mode-vi C-h select-pane -L |
85 | 54 | bind-key -T copy-mode-vi C-j select-pane -D |
86 | 55 | bind-key -T copy-mode-vi C-k select-pane -U |
87 | 56 | bind-key -T copy-mode-vi C-l select-pane -R |
88 | | -bind-key -T copy-mode-vi C-\ select-pane -l |
| 57 | +bind-key -T copy-mode-vi 'C-\' select-pane -l |
89 | 58 |
|
90 | 59 | # Theme file ################################################################ |
91 | 60 | source-file ~/dotfiles/tmux.conf.basic |
92 | 61 |
|
93 | | -# List of plugins |
94 | | -set -g @plugin 'tmux-plugins/tpm' |
95 | | -set -g @plugin 'tmux-plugins/tmux-resurrect' |
96 | | - |
97 | | -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) |
98 | | -run -b '~/.tmux/plugins/tpm/tpm' |
| 62 | +run-shell ~/dotfiles/tmux/plugins/tmux-resurrect/resurrect.tmux |
0 commit comments