getting clipboard support for vim

0

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:

-clipboard
-x11
-xterm_clipboard

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.

Luke

Posted 2014-08-30T17:28:01.010

Reputation: 305

Was the file you wanted to paste to inside or outside vim? – Finn O'leary – 2014-08-30T22:05:23.813

Inside, but I'd like to be able to do both – Luke – 2014-08-30T22:45:18.227

Answers

2

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.

romainl

Posted 2014-08-30T17:28:01.010

Reputation: 19 227

Will this overwrite my .vimrc? – Luke – 2014-08-30T22:45:47.803

No, of course not. As long it's really your .vimrc, in your $HOME. – romainl – 2014-08-30T22:53:53.687