christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.24k stars 322 forks source link

Documentation: Nested tmux: Update needed? #218

Open UzK98fYoE opened 5 years ago

UzK98fYoE commented 5 years ago

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!

christoomey commented 5 years ago

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.

seanw2020 commented 5 years ago

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)?$'"
Zerophase commented 2 years ago

@seanw2020 Does your configuration work for moving in and out of nested tmux sessions? How is your tmux configured on the remote machine?

GopherJ commented 11 months ago

do you have complete tmux configuration, I tried this is_vim but it didn't worked