I am using vim over ssh for remote development. I am not able to copy/yank to system clipboard

So here is my workflow.
I first create an ssh connection to the remote host. start a tmux sessions there and then open neovim.
I open up a file and want to copy a text.
With normal y it works. this I can only paste in another buffer/tab in neovim.

What I now want is to copy this text to the system clipboard. I am on mac. This doesn’t work.
Any way I can make it work to copy it to the system clipboard.

Another thing I have tried is to create the tmux session on my local machine and then in one split I ssh and open neovim on remote. Still that doesn’t work.

While we are here, is there any way I can use neovim on my local to do remote development?

Yes. You can use the progame sshfs to mount a remote machine into your local file system. You then start Neovim on your local machine to edit files on your remote machine. The remote files will appear as if they were part of your local file system. Reading and writing will be a bit slower because even though the remote files appear as if they were on your local system, under the hood there is still copying going on over the network.

The advantage is that you can use all the settings and plugins from your local Neovim setup. The disadvantage is that using anything from the remote setup becomes harder.

Use this

1 Like

thank you for the suggestion but it’s kind slow for development work.

I have the same workflow and use clipper for yanking text from neovim on the remote machine into the clipboard on my Mac. Works great.