added tmux and nvim integration for pane switching
This commit is contained in:
@@ -22,11 +22,12 @@ set -g history-limit 50000
|
||||
# reload config
|
||||
bind C-r source-file ${XDG_CONFIG_HOME}/tmux/tmux.conf \; display "Config reloaded!"
|
||||
|
||||
# switch panes using Alt-arrow without prefix
|
||||
bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
# switch panes using Alt-arrow without prefix - detect when we are in vim and switch panes there instead
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
|
||||
bind -n M-Left if-shell "$is_vim" 'send-keys M-Left' 'select-pane -L'
|
||||
bind -n M-Right if-shell "$is_vim" 'send-keys M-Right' 'select-pane -R'
|
||||
bind -n M-Up if-shell "$is_vim" 'send-keys M-Up' 'select-pane -U'
|
||||
bind -n M-Down if-shell "$is_vim" 'send-keys M-Down' 'select-pane -D'
|
||||
|
||||
# vim style switch pane
|
||||
bind h select-pane -L
|
||||
|
||||
Reference in New Issue
Block a user