vim-tmux-navigator
vim-tmux-navigator copied to clipboard
Documentation: Nested tmux: Update needed?
First, thank you for tmux!
Second, when you write in the README:
When nesting tmux sessions via ssh or mosh, you could extend it to look like '(^|/)g?(view|vim|ssh|mosh?)(diff)?$', which makes this plugin work within the innermost tmux session and the vim sessions within that one.
Could you provide a complete, working example? Should we "extend", "add", or completely rewrite the single-quoted regex? Also, the regexp you mention, '(^|V)g?...', starts differently from your code here, so I was a bit confused.
Regardless, the following worked (where "worked" means inner tmux's vim sessions' bindings work as expected) for me, but maybe I'm misunderstanding something?
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|vim|ssh|mosh?)(diff)?$'"
Thanks again!
Hi @UzK98fYoE, I personally don’t use or recommend using this plugin in a nestsed context due to the inherent complexity, so I don’t have much to add here. That said, it sounds like you’ve found something that works which is great, and I appreciate you sharing it here for anyone else who runs into this. Again, I don’t have much to add and I don’t plan to add any more formal support or documentation around this so I’m going to close this issue now, but thanks again for summing things up.
I can confirm that this works on Ubuntu, Debian, CentOS, and MacOS (brew), but for neovim, you have to add nvim
like below. Could you update the README in the Nested section? I'll try to create a Pull Request otherwise:
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|vim|nvim|ssh|mosh?)(diff)?$'"
@seanw2020 Does your configuration work for moving in and out of nested tmux sessions? How is your tmux configured on the remote machine?
do you have complete tmux configuration, I tried this is_vim but it didn't worked