dotfiles/.config/tmux/tmux_binds.conf
2023-12-10 21:22:07 +00:00

24 lines
663 B
Text

# tmux_binds.conf
# Binds
bind-key 'x' kill-pane
bind-key 'h' previous-window
bind-key 'j' switch-client -p
bind-key 'k' switch-client -n
bind-key 'l' next-window
bind-key 'n' new-window
bind-key 'c' kill-window
# Decide whether we're in a Vim process
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
unbind y
bind-key 'y' if-shell "$is_vim" 'send-keys F5' 'select-pane -L'
unbind u
bind-key 'u' if-shell "$is_vim" 'send-keys F6' 'select-pane -D'
unbind i
bind-key 'i' if-shell "$is_vim" 'send-keys F7' 'select-pane -U'
unbind o
bind-key 'o' if-shell "$is_vim" 'send-keys F8' 'select-pane -R'