0
I'm having an issue where text yanked to unnamed
is not available to paste afterwards. This only occurs when I am SSHd in to another machine. Both machines are running identical versions of OS X (10.9.2), Vim (7.4, compiled with brew install vim --override-system-vim
) and the output is the same on both machines:
vim --version | head -n 2
=> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 12 2014 13:11:40)
=> MacOS X (unix) version
:echo has("clipboard")
=> 1
:set clipboard?
=> clipboard=unnamed
In a document, when I yank text and then immediately attempt to paste it, I see E353: Nothing in register *
. I have also tried "*y
and receive the same error. When I enter insert mode and cmd-v
, it pastes the last thing I copied outside of vim. I tried "+y
, then "+p
but receive the same error (referencing *
) which I believe is expected, and cmd-v
still does not paste what I want.
How do I get vim clipboards to work properly when I am SSHd across machines?
I'll give that a shot, thanks for the heads up. In the meantime, I have a question: if I'm SSH'd in to a machine, shouldn't yank and paste both be run within the context of the remote machine? In the simple example of one vim session with one buffer, vim should be using the same register for both operations, correct? Is the issue because it's being sent to unnamed, and I should instead account for SSH instances and force vim to copy to a different register in that case? – Josh Whittington – 2014-04-04T20:51:26.140
The only Vim registers that can be seen from outside of Vim are
*
and+
. On Mac OS X, they are just the same so using one or the other doesn't matter andset clipboard=unnamed
makes it all irrelevant anyway because what you yanked in Vim is put into the system's clipboard. X11 is set by default (you should check that) to "capture" Mac OS X's clipboard so, thanks to X11 Forwarding, you can paste locally what you copied on your server and paste remotely what you copied on your client. It works very well between two Linuxes or between Mac OS X and Linux. – romainl – 2014-04-04T21:16:38.763