tmux-vim
tmux-vim copied to clipboard
Running on remote ssh host
Not sure if this will work, but worth a try...
First, replace literal tmux invocations with $TMUX_VIM_TMUX_BIN.
Then, when running tmux on local, ssh to remote, and try: TMUX_VIM_TMUX_BIN='ssh local tmux' TMUX_VIM_VIM_BIN='ssh remote vim'
The tmux-vim script will be running on remote, talking to tmux on local, which will in turn spawn vim on remote.
Will need ssh-keys in both directions.
Need a -t option for ssh or vim complains about input not being from a terminal
TMUX_VIM_VIM_BIN='ssh -t remote vim'
TMUX_PANE isn't set on remote, which is a pain.
I'm expecting this remote-mode would be enabled via some script, so this could possibly be auto-detected somehow and set manually.
Can't just substitute tmux @args
with $tmux_bin @args
- seems to be some shell quoting issues, in particular with
the # character in the format strings.
$tmux_bin $( printf '%q ' @args )
seems to work
Have managed to get the first open working. Pane splits and vim opens with the file.
Further opens however create a new split.
Need to check that the vim cwd is correct as well.
ssh -t remote "export TMUX_PANE=$TMUX_PANE; \$SHELL"
Seems to work...