Faster pane navigation in tmux #154
b0o
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
Woah, this is cool! Couldn't I theoretically have the plugin set the pane-local tmux option and unset it on nvim exit, so that the background script wouldn't be needed? I actually do something like that for Wezterm already. smart-splits.nvim/plugin/smart-splits.vim Lines 64 to 74 in 33c8507 This way the default out-of-the-box plugin configuration would have this improvement. |
Beta Was this translation helpful? Give feedback.
2 replies
-
This is now the default implementation since #155, thank you for sharing! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The recommended tmux configuration for navigating panes is slower than it needs to be, because it's checking if a pane contains vim at the moment you press the keybinding to switch panes. This leads to a noticeable delay.
I wrote a script for tmux that runs in the background and periodically checks which panes contain vim and sets a pane-local option. Then, when you hit the keybinding to switch panes, tmux only needs to check for this option to determine what to do, rather than shelling out to
ps
andgrep
. With this approach, there is virtually no lag when switching panes.You don't need to change your vim-tmux-navigator configuration at all to use it.
The script: https://github.com/b0o/tmux-conf/blob/main/navi.tmux
To install:
tmux.conf
:run-shell "$XDG_CONFIG_HOME/tmux/navi.tmux"
(change the path to wherever you put the script)Beta Was this translation helpful? Give feedback.
All reactions