With vim I got really addicted to keyboard-only usage. But there is one thing I was always missing: integration with the system clipboard. I had to switch back to the mouse for that. As I learned today system clipboard is supported by vim. Unfortunately the version packaged with OSX is not compiled with this feature enabled.
You can check this yourself by typing
vim --version on the command line. The output should contain something like
+ means enabled). Probably you have a
- instead. Luckily with homebrew you can easily install vim with clipboard enabled.
1. Install Vim
This will install vim in the
/usr/local/bin directory. So far the original vim is still in place and used. We have to give the brew version precedence.
2. Update PATH Order
An easy way to make sure the homebrew version is loaded is to make sure its path is defined before the system path. Locate your
For bash it’s one of these files:
For zsh open this file:
/usr/local/bin is declared before
Reload the config, with zsh for example: http://localhost:4000/blog/2013/11/15/vim-with-system-clipboard/
1 2 3
The vim path should be
vim --version should contain the
+clipboard. A nice side effect of changing the PATH order is that you can also update git using homebrew.
3. Enable Clipboard in .vimrc
As a last step you have to enable the system clipboard in vim. Open your
.vimrc and add the following line:
From now on you should be able to use the system clipboard when using vim verbs (