macosvimssh

vim + COPY + mac over SSH


I access a sever over ssh on which I run vim for editing files. When I try to yank text from vim into an editor locally on my mac (lion) either with y OR "+y it does not work. I end up with the text I copied last locally. It does work if I just use p within vim alright.


Solution

  • To expand on Ray's answer…

    When you are using Vim on a remote server via SSH, everything you do in Vim is done on the remote server. The remote server and the remote Vim that you are running on it have zero practical knowledge of your local computer and its system clipboard.

    Because of that, y will never put the yanked text in your local clipboard.

    In order to copy a chunk of text from the remote Vim to your local machine's clipboard you have three options: