I'm running vim on a Debian Jessie machine inside of a VirtualBox on my Mac. I'm trying to get yy and p to work so I can copy and paste across different terminal windows by using the system clipboard. Please note the following:

1) echo has('clipboard') returns 1 (I have vim-gtk installed)

2) My .vimrc file is as follows:

syntax on
set mouse=a
set clipboard=unnamedplus

3) I've logged into the ssh session with ssh -XY me@host>to allow x11 forwarding

4) The Debian machine is headless.

5) When I'm logged into the machine directly instead of over ssh, I still can't copy to the system clipboard.

When I do yy or even "+yy and then do :reg to look inside the registers, there is no listing for the "+ register.

Not sure what else to try.

  • What does :reg + give after "+yy? Also, I'd recommend trying set clipboard=unnamedplus,unnamed.
    – Tumbler41
    May 1 '17 at 16:18
  • :reg doesn't show the + register at all. The only way I can get the system clipboard to work is to run the guest with the full GUI and a native terminal app open in the GUI.
    – StevieD
    May 1 '17 at 23:33
  • You didn't answer my question. What does :reg + give? On my machine :reg + shows the * register, which is why you don't see + in the full :reg command.
    – Tumbler41
    May 1 '17 at 23:38
  • It doesn't show anything. It doesn't exist.
    – StevieD
    May 1 '17 at 23:45
  • You say "terminal" window in the question. Can you use the clipboard from the terminal itself? e.g. with xclip or xsel? Also, it is very strange that :echom has("clipboard") gives 1 and :reg + fails (it should be the same code). What does vim --version actually say about the clipboard?
    – grochmal
    May 2 '17 at 1:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.