How to install vim with clipboard support on Fedora?

21

6

I'm using Fedora Linux and don't have the ability to copy text from vim into the system clipboard (which I should be able to do by using the + or * register, though I'm not sure which). If I type this at the command line:

vim --version | grep clipboard

... the relevant line says -xterm_clipboard, when what I want to see is +xterm clipboard.

How can I add this support? Do I have to compile something (please say no!) or can I just yum install something?

Nathan Long

Posted 2010-10-01T11:32:33.250

Reputation: 20 371

Answers

34

vim in Fedora is compiled without any X support in order to minimize the number of dependencies it has. You'll need to use gvim instead, in the vim-X11 package.

Ignacio Vazquez-Abrams

Posted 2010-10-01T11:32:33.250

Reputation: 100 516

6Fedora package vim-X11 ships also binary vimx, so you can run that one within X11 if you don't want to alias. – LukasT – 2014-12-19T08:05:45.207

@LukasT indeed great point - this works perfectly. This Vi.SE answer suggests the same.

– icc97 – 2017-08-19T21:40:04.480

Excellent! In Arch Linux, the default Vim lacks system support [per https://stackoverflow.com/questions/11489428/how-to-make-vim-paste-from-and-copy-to-systems-clipboard, :echo has('clipboard') returns 0]. Installing Gvim,instead of Vim, provides a Vim version that returns 1 for that command. – Victoria Stuart – 2017-10-17T20:08:08.830

25Note that while you'll need the version of Vim that supports X, you don't need to run it as an X application--you can run it in a terminal as gvim -v. That will launch Vim in vi or terminal mode but with access to the X clipboard. You can make this easier with an alias: alias vim='gvim -v'. – garyjohn – 2010-10-01T15:43:26.170

@garyjohn - awesome! That works perfectly. – Nathan Long – 2010-10-01T16:06:26.630

1@garyjohn - ...and, your awesome tip about running graphical vim on the command line has come in handy yet again, this time on a Mac. mvim -v also gives access to the system clipboard. Thanks! – Nathan Long – 2011-11-18T19:29:37.247