comparison dot_tmux.conf @ 348:f220567b278e

Update tmux-vim mapping
author Zeger Van de Vannet <zegervdv@me.com>
date Thu, 04 Feb 2021 18:28:57 +0100
parents 88d7010b5694
children 44442a6b8aa6
comparison
equal deleted inserted replaced
347:a128f9c0f02e 348:f220567b278e
1 set-environment -g PATH "/project/asic_fpga/tools/tmux/bin:$PATH" 1 set-environment -g PATH "/project/asic_fpga/tools/tmux/bin:$PATH"
2 2
3 # Nested TMUX sessions (from 3 # Nested TMUX sessions (from
4 # https://medium.freecodecamp.org/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795) 4 # https://medium.freecodecamp.org/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795)
5 bind -T root F12 \ 5 bind -T root F11 \
6 set prefix None \;\ 6 set prefix None \;\
7 set key-table off \;\ 7 set key-table off \;\
8 set status-right "#[fg=colour0,bg=colour1] DISABLED #[fg=colour3,bg=colour0] #{session_name}#[fg=colour1] | #[fg=colour2]%d %b %l:%M %p " 8 set status-right "#[fg=colour0,bg=colour1] DISABLED #[fg=colour3,bg=colour0] #{session_name}#[fg=colour1] | #[fg=colour2]%d %b %l:%M %p "
9 refresh-client -S \;\ 9 refresh-client -S \;\
10 10
11 bind -T off F12 \ 11 bind -T off F11 \
12 set -u prefix \;\ 12 set -u prefix \;\
13 set -u key-table \;\ 13 set -u key-table \;\
14 set -u status-right \;\ 14 set -u status-right \;\
15 refresh-client -S 15 refresh-client -S
16 # improve colors 16 # improve colors
33 setw -g window-status-current-style fg=red 33 setw -g window-status-current-style fg=red
34 34
35 set -g status-justify "left" 35 set -g status-justify "left"
36 set -g status-bg "colour0" 36 set -g status-bg "colour0"
37 set -g status-fg "colour7" 37 set -g status-fg "colour7"
38 set -g message-bg "colour0" 38 # set -g message-bg "colour0"
39 set -g message-fg "colour8" 39 # set -g message-fg "colour8"
40 40
41 setw -g window-status-bell-style "fg=colour0,bg=colour5" 41 setw -g window-status-bell-style "fg=colour0,bg=colour5"
42 42
43 bind s split-window -v -c "#{pane_current_path}" 43 bind s split-window -v -c "#{pane_current_path}"
44 bind v split-window -h -c "#{pane_current_path}" 44 bind v split-window -h -c "#{pane_current_path}"
65 65
66 # Smart pane switching with awareness of Vim splits. 66 # Smart pane switching with awareness of Vim splits.
67 # See: https://github.com/christoomey/vim-tmux-navigator 67 # See: https://github.com/christoomey/vim-tmux-navigator
68 is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ 68 is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
69 | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" 69 | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
70 bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" 70 bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
71 bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" 71 bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
72 bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" 72 bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
73 bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" 73 bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
74 bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" 74 tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
75 bind-key -T copy-mode-vi C-h select-pane -L 75 if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
76 bind-key -T copy-mode-vi C-j select-pane -D 76 "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
77 bind-key -T copy-mode-vi C-k select-pane -U 77 if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
78 bind-key -T copy-mode-vi C-l select-pane -R 78 "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
79 bind-key -T copy-mode-vi C-\ select-pane -l 79
80 bind-key -T copy-mode-vi 'C-h' select-pane -L
81 bind-key -T copy-mode-vi 'C-j' select-pane -D
82 bind-key -T copy-mode-vi 'C-k' select-pane -U
83 bind-key -T copy-mode-vi 'C-l' select-pane -R
84 bind-key -T copy-mode-vi 'C-\' select-pane -l
80 #act like GNU screen 85 #act like GNU screen
81 unbind C-b 86 unbind C-b
82 set -g prefix C-Space 87 set -g prefix C-Space
83 bind Space send-prefix 88 bind Space send-prefix
84 set -g escape-time 20 89 set -g escape-time 20