1

I am on Ubuntu 14.04.3 and Vim 8.2. I'm trying to figure out how to access either the * or + clipboard on Ubuntu but it seems like it doesn't exist? After doing "*yy and "+yy on lines of text, here is what it shows:

:reg + *
Type Name Content
[empty]

Neither + or * exists in there. It seems like it's set to use the unnamedplus register:

:echom has('unnamedplus') 
" 1

:echom has('unnamed') " 0

Then I try doing (again):

:set clipboard=unnamedplus

And doing "+yy again, but still nothing shows up in the register. Is there no 'system clipboard' on ubuntu (accessible by vim), or if so, how can I get that to work?

Also, I've verified my vim is compiled with both clipboard-related options:

+xterm_clipboard
+clipboard
+X11
Vivian De Smedt
  • 16,336
  • 3
  • 18
  • 37
David542
  • 2,445
  • 14
  • 50
  • Do you also have the feature +X11? – Ralf Jul 01 '20 at 05:36
  • Please provide more information about your system. Did you start a X-server? Is $DISPLAY correctly set? Are you doing anything unusual, like ssh'ing to a different server? – Christian Brabandt Jul 01 '20 at 06:26
  • @Ralf yes, that as well (updated question with it) – David542 Jul 01 '20 at 06:51
  • @ChristianBrabandt yes, I am ssh'ing into the Ubuntu server from my local Mac. How can I check display and x-server? And, what other system information do you want to provide (and how can I get that info?) – David542 Jul 01 '20 at 06:52
  • 1
    Well, if you are using ssh, things are very much complicated. Make sure that $DISPLAY is correctly set, and you need to use ssh -Y or ssh -X for that to work reliable (or the ForwardX11 config option set or whatever it is called). Then you probably also need to be run a local X11 server on your mac (I don't know Mac so this might be wrong). There are probably already questions about this, please search – Christian Brabandt Jul 01 '20 at 07:05
  • probably a duplicate of this answer: https://vi.stackexchange.com/a/96/71 – Christian Brabandt Jul 01 '20 at 07:10
  • https://stackoverflow.com/questions/47822357/how-to-use-x11-forwarding-to-copy-from-vim-to-local-machine – muru Jul 01 '20 at 07:43
  • 1
    We already have a lot of similar question example, example and an authoritative answer so I'll close this one. If despite the information in these links you still don't find a solution please edit your question to show exactly what is different from these other ones and cast a vote to reopen the question. – statox Jul 01 '20 at 09:15

0 Answers0