Consolidate tmux and vim navigation
This commit is contained in:
@@ -60,6 +60,7 @@ in
|
||||
copilot-cmp
|
||||
CopilotChat-nvim
|
||||
opencode-nvim
|
||||
vim-tmux-navigator
|
||||
bullets-vim
|
||||
nvim-dap
|
||||
nvim-nio
|
||||
|
||||
@@ -23,11 +23,15 @@ in
|
||||
unbind S
|
||||
bind S command-prompt "switch -t %1"
|
||||
|
||||
bind-key -n M-K if -F "#{pane_at_top}" "switch-client -p" "select-pane -U"
|
||||
bind-key -n M-J if -F "#{pane_at_bottom}" "switch-client -n" "select-pane -D"
|
||||
# Check if we are in vim
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
|
||||
bind-key -n M-L if -F "#{pane_at_right}" "next-window" "select-pane -R"
|
||||
bind-key -n M-H if -F "#{pane_at_left}" "previous-window" "select-pane -L"
|
||||
bind-key -n M-K if-shell "$is_vim" "send-keys M-K" "if -F \"#{pane_at_top}\" \"switch-client -p\" \"select-pane -U\""
|
||||
bind-key -n M-J if-shell "$is_vim" "send-keys M-J" "if -F \"#{pane_at_bottom}\" \"switch-client -n\" \"select-pane -D\""
|
||||
|
||||
bind-key -n M-L if-shell "$is_vim" "send-keys M-L" "if -F \"#{pane_at_right}\" \"next-window\" \"select-pane -R\""
|
||||
bind-key -n M-H if-shell "$is_vim" "send-keys M-H" "if -F \"#{pane_at_left}\" \"previous-window\" \"select-pane -L\""
|
||||
|
||||
bind '"' split-window -c "#{pane_current_path}"
|
||||
bind % split-window -h -c "#{pane_current_path}"
|
||||
|
||||
Reference in New Issue
Block a user