I have setup vim to be able to yank text from the server instance of vim to the clipboard on My client's operating system (through the SSH connection).
The basic setup is
- Client side
- gnome-terminal
- Serverside
- SSH with X11 session forwarding e.g.
ssh -Y <user>@<server>
- Tmux
- vim-gtk
- Tmux
- SSH with X11 session forwarding e.g.
vim version running on server – vim-gtk
with extras necessary to copy to the system clipboard
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:40:46)
Included patches: 1-52
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2 GUI. Features included (+) or not (-):
- Operating System Ubuntu 14.04
Inside vim (running on server) I can visual select text – then hit ", +, y and I will then have that visual selection available back on My client OS clipboard.
This works when I connect to the server and start a new tmux session, but when I reconnect to the server after the SSH has broken and reattach to tmux session it stops working.
Any ideas why this could be?
Best Answer
This is my solution (thanks for the xpra pointer). It goes like this:
From .bashrc