chore: Tmux + nvim integration panels

This commit is contained in:
Afonso Franco 2023-05-18 14:40:19 +01:00
parent ba343b3652
commit 200f16359e
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4
2 changed files with 83 additions and 24 deletions

View file

@ -3,7 +3,35 @@ set -ag terminal-overrides ",$TERM:RGB"
set -sg escape-time 0
#binds
bind-key x kill-pane
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
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# 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'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
bind-key -T copy-mode-vi 'y' select-pane -L
bind-key -T copy-mode-vi 'u' select-pane -D
bind-key -T copy-mode-vi 'i' select-pane -U
bind-key -T copy-mode-vi 'o' select-pane -R
# List of plugins
set -g @plugin 'tmux-plugins/tpm'