Can I copy from vim to another window without +xterm-clipboard

copy/pastevim

I'm using Ubuntu and vim. I can copy text from vim and paste it into another window by highlighting it in vim, then middle-clicking in the other window. This works fine when I'm on my local machine.

I can also copy into the system register by highlighting text and yanking to the system register. (For example, Shift-V JJ "+ y to go into linewise visual mode, highlight two lines, select the '+' register and yank.) It's then available to paste into other windows.

However, if I ssh into my web host, I can't do either of these. (They use some flavor of Linux – I think it's CentOS.)

In vim, if I type :version, my local version shows +xterm_clipboard, but the host's version shows -xterm_clipboard. I don't have sudo rights there.

Is there any way to be able to copy from their vim without getting them to tinker with the installation?

Best Answer

When you use ssh, you generally don't want the other computer to have access to your x session for security reasons. But if you do an ssh -X (again, you should understand the security implications) I think it should allow the remote shell to access the x windows clipboard.

Related Question