Is it possible to run a Vim clientserver instance over SSH+tmux

tmuxvim

I've been a vim junkie for a year or so now and I've got some great little tricks burnt in to my memory. I do a lot of development (at the office) in a terminal on Ubuntu.

One of the things I value most is having tmux taking care of my sessions so that if Gnome, or anything else, decides to kirk out then I haven't lost a thing.

Additionally, I run a vim clientserver (C-b :neww 'vim –servername d') as one of my tmux windows and use it to receive any files I want to work with while I have my other tmux windows doing various jobs. It means I can have one vim open with no confusion about what I'm editing.

When I'm working remotely (via SSH,) I connect to my tmux session and carry on but I have one problem: vim won't start a client-server instance.

I presume it is X related but I can't seem to find the difference between a local tmux and a tmux via ssh.

Best Answer

Yes, it uses X properties to communicate. Try running your remote SSH session with the -X option to allow X11 forwarding. You may also have to enable that feature on the server side. You may also have to manually adjust the DISPLAY environment variable (to "localhost:10.0") since the existing session will already have your local one from when it started.

Related Question