I am using vim in a terminal emulator on Ubuntu 14.04.

I have been using it for a while and had been getting along fine, until I had to copy lines from one file to another. After some searching I found what I needed, which was to do:

 set clipboard=unnamed

However, This wasn't working and neither was explicitly using the * register.
Turns out, I don't have clipboard support. Here is the output of vim --version Vim --version outpu

Note the entries:


So how can I get clipboard support? Is it necessary to install a completely new version of Vim?

For now, I am using :read and sed combined to get the line numbers that I want, but I would like a cleaner solution.

  • Was the file you wanted to paste to inside or outside vim? – Finn O'leary Aug 30 '14 at 22:05
  • Inside, but I'd like to be able to do both – Luke Aug 30 '14 at 22:45

Clipboard support is only one command away:

$ sudo apt-get install vim-gnome

But you could simply edit all your files in Vim and yank/put between buffers.

  • Will this overwrite my .vimrc? – Luke Aug 30 '14 at 22:45
  • No, of course not. As long it's really your .vimrc, in your $HOME. – romainl Aug 30 '14 at 22:53

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.