tmux-vim icon indicating copy to clipboard operation
tmux-vim copied to clipboard

Running on remote ssh host

Open sdt opened this issue 12 years ago • 5 comments

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.

sdt avatar Aug 21 '12 22:08 sdt

Need a -t option for ssh or vim complains about input not being from a terminal

TMUX_VIM_VIM_BIN='ssh -t remote vim'

sdt avatar Aug 22 '12 00:08 sdt

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.

sdt avatar Aug 22 '12 00:08 sdt

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

sdt avatar Aug 22 '12 00:08 sdt

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.

sdt avatar Aug 22 '12 00:08 sdt

ssh -t remote "export TMUX_PANE=$TMUX_PANE; \$SHELL"

Seems to work...

sdt avatar Aug 22 '12 01:08 sdt