How to install vim with clipboard support on Fedora?
9,455
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.
Related videos on Youtube
Author by
Nathan Long
I code mostly in Ruby and Elixir. More about me at nathanmlong.com and Stackoverflow Careers.
Updated on September 17, 2022Comments
-
Nathan Long over 1 year
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? -
garyjohn over 13 yearsNote 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'
. -
Nathan Long over 13 years@garyjohn - awesome! That works perfectly.
-
Nathan Long over 12 years@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! -
LukasT over 9 yearsFedora package vim-X11 ships also binary
vimx
, so you can run that one within X11 if you don't want to alias. -
icc97 over 6 years@LukasT indeed great point - this works perfectly. This Vi.SE answer suggests the same.
-
Victoria Stuart over 6 yearsExcellent! In Arch Linux, the default Vim lacks system support [per stackoverflow.com/questions/11489428/…, :echo has('clipboard') returns 0]. Installing Gvim,instead of Vim, provides a Vim version that returns 1 for that command.