0

I work on a remote server and would like to yank stuff to the server's clipboard. However "+y gives me an error flash (visual terminal bell) and when quitting vim, I can't paste in the terminal.

Maybe this is an issue with ssh not correctly transmitting Ctrl-Shift-V?

9
  • 1
    The clipboard is managed by the X server, which is presumably running on your local machine. Applications such as vim running on the remote server won't be able to contact the local X server (and use the clipboard) unless you forward the X connection over your ssh channel. To do that, you'll need to run ssh with the -Y or -X option, or put ForwardX11Trusted = yes or ForwardX11 = yes in your ~/.ssh/config file.
    – garyjohn
    Jan 5, 2017 at 19:38
  • @garyjohn It is not my intention to copy and paste between local and remote clipboard, but simply from remote vim to remote system clipboard. Maybe I'm misunderstanding you.
    – oarfish
    Jan 5, 2017 at 19:39
  • No, you didn't misunderstand me. Unless I'm missing something, there is no mechanism to copy and paste from a remote system clipboard. The X-aware applications that you run on the remote server via ssh do not communicate with any remote X server--they communicate with the local X server if X traffic is being forwarded over the ssh connection.
    – garyjohn
    Jan 5, 2017 at 19:56
  • But when I start vim in an ssh session, this instance should have a + register, right? Even if pasting from it outside vim doesn't work, why would it error when trying to use that register?
    – oarfish
    Jan 5, 2017 at 20:38
  • 1
    So I guess that makes this question a duplicate of our most upvoted question?
    – statox
    Jan 6, 2017 at 9:20

0

Browse other questions tagged or ask your own question.