On OS X
If you use Homebrew, you can get Vim with
+clipboard by running:
brew install vim
Here's a gist from running
Alternatively, you could download MacVim. Look inside
/Applications/MacVim.app/Contents/MacOS, and you'll see that the app provides two binaries:
MacVim, which launches the GUI, and
Vim, which runs in the Terminal with the same feature set. Both versions include the
+clipboard feature. Here's a gist from running
If your Linux distribution ships Vim with the
+clipboard feature, leave a comment saying which distribution you use. If not, read on.
I don't run a desktop Linux environment, so I ran some tests against Ubuntu 12.04 inside Vagrant. The default
vi binary has
-clipboard (gist of
vi --version). If you attempt to run
vim, it prompts you to install a package:
vagrant@precise32:~$ vim --version The program 'vim' can be found in the following packages: * vim * vim-gnome * vim-tiny * vim-athena * vim-gtk * vim-nox Try: sudo apt-get install <selected package>
I tried installing each of these and found that
vim-gtk each included the
+clipboard feature. I've created a gist from running
vim --version for each of these packages: vim-gnome, vim-athena, and vim-gtx. The vim and vim-nox packages both had
Robin Skahjem-Eriksen wrote to me with a tip: you can run GVim inside the terminal by launching it with the
gvim -v command. That could be handy if your distribution ship
-clipboard, but also ships
If you have any more tips on how to obtain Vim with the
+clipboard feature, please share them in a comment.
Can we fix this?
Being able to access the system clipboard from Vim is essential. It's a nuisance that so many systems ship Vim without the
+clipboard feature! I'd like to see that change. Please make the information in this article obsolete by campaigning to have
+clipboard enabled by default on your system.