7

I want to copy text from visual mode into system (Ubuntu) clipboard. When I do ggVG to select everything in Vim, I can't seem to copy that into system clipboard.

Now I read several options on how to do this, but none of them works. For example this does not work: "+y or "+ or "*yy

Why is it not working?

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
user3763437
  • 359
  • 2
  • 10

1 Answers1

9

You are probably using the default Vim. It's a lightweight build that lacks a number of features including clipboard support.

You can verify that with this command:

:echo has('clipboard')

O (zero) means "no clipboard support".

The simplest way to get clipboard support is to install a proper build:

$ sudo apt-get install vim-gnome

Then, you'll be able to do "+y and "+p.

See :help 'clipboard' for a way to synchronize Vim's unnamed register and your system clipboard.

romainl
  • 186,200
  • 21
  • 280
  • 313