-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Say I open multiple Tmux panes, the pane under focus is running Neovim in insert mode. I am not able to navigate to other panes using keyboard shortcuts. I have to switch to normal mode in Neovim and only then can I navigate from the pane running Neovim to another pane.
Expected behavior
With proper settings, I hope that I can navigate between Tmux panes freely using keyboard shortcuts, even when the pane is running Neovim/Vim in insert mode.
Screenshots
Versions
Tmux 3.3a
tmux.nvim commit 673782b (2023 Sept 6)
My settings
Tmux settings:
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' { if -F '#{pane_at_left}' '' 'select-pane -L' }
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' }
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' { if -F '#{pane_at_top}' '' 'select-pane -U' }
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' { if -F '#{pane_at_right}' '' 'select-pane -R' }
bind-key -T copy-mode-vi 'C-h' if -F '#{pane_at_left}' '' 'select-pane -L'
bind-key -T copy-mode-vi 'C-j' if -F '#{pane_at_bottom}' '' 'select-pane -D'
bind-key -T copy-mode-vi 'C-k' if -F '#{pane_at_top}' '' 'select-pane -U'
bind-key -T copy-mode-vi 'C-l' if -F '#{pane_at_right}' '' 'select-pane -R'
Neovim settings:
local status_ok, tmux = pcall(require, "tmux")
if not status_ok then
return
end
tmux.setup {
navigation = {
cycle_navigation = false,
enable_default_keybindings = true,
persist_zoom = false,
},
resize = {
enable_default_keybindings = false,
},
}
Question
Is there any way in which I can navigate between Tmux panes freely using keyboard shortcuts, even when the pane is running Neovim/Vim in insert mode? If so, how? Thanks!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request