smart-splits.nvim allows for easier resizing of neovim splits, also handled tmux integration

This commit is contained in:
2024-04-18 03:52:03 +02:00
parent 1125c6543a
commit ad8a5caa99
3 changed files with 44 additions and 23 deletions

View File

@@ -19,11 +19,16 @@ unbind C-b
set -g prefix C-a
# Improve navigation between tmux and nvim
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
# TODO: Disable pane selection wrap
bind-key -n M-h if -F "#{@pane-is-vim}" 'send-keys M-h' 'select-pane -L'
bind-key -n M-j if -F "#{@pane-is-vim}" 'send-keys M-j' 'select-pane -D'
bind-key -n M-k if -F "#{@pane-is-vim}" 'send-keys M-k' 'select-pane -U'
bind-key -n M-l if -F "#{@pane-is-vim}" 'send-keys M-l' 'select-pane -R'
bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
# Custom keybinds
bind '"' split-window -c "#{pane_current_path}"