Anyone know how I can use the same keys to move between Vim windows as well as Tmux (or tiling WM) panes?

For example when I use my key combination to move to the right pane within VIM, VIM should first detect if there actually is a VIM pane to the right. If not it should call a Tmux command to move to the tmux pane on the right (if a tmux pane on the right exists).

Something similar would have to happen if you move back while being in a Tmux pane.

I suppose that besides Tmux you could also use this with a tiling window manager.

Going from the last vim window to the next tmux pane should be possible; switching to the correct vim window when you return to the vim pane (depending on which "direction" you arrived from) may be nearly impossible.
–
chepnerAug 25 '12 at 19:53

Just out of curiosity, have you managed to get this to work?
–
Justin L.Mar 3 '13 at 20:56

1 Answer
1

Mislav Marohnic and thoughtbot's Chris Toomey came up with a solution to this here. It uses Ctrl+h/j/k/l to switch between panes in both Vim and tmux in the way you would expect; and Ctrl+\ to switch to the previous one.

Edit: I previously suggested something I never actually tried out. If for some reason you're interested in it, see this answer's edit history.