Q:

Vim: access to system clipboard via ssh - Linux to OS X

I'm Linux user who often needs to work on remote OS X server via SSH. I prefer vim (neovim) editor but I have problem with copy/paste to/from system clipboard via SSH. When I try to copy line "*yy it saves on remote OS X clipboard. Is there a way to save it to my Linux clipboard instead?

A:

Basically, you can just open remote file on your linux machine like:
:e scp://user@host/relative/path/from/home.txt

Another solution to copy directly from ssh session would be X11 forwarding in ssh which connects system clipboard between remote and local machine.

Enable X11Forwarding on the SSH server side in /etc/ssh/sshd.conf
Use the -Y option for ssh client to enable it when connecting:
ssh -Y your_server

Now you can copy in the remote Vim using "*yy and paste it locally in Vim using "*p or paste it in any GUI app using Ctrl-V.

