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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With