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
  • 154,018
  • 15
  • 205
  • 275
user3763437
  • 365
  • 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
  • 158,436
  • 18
  • 236
  • 264