Gain clipboard support for Vim on OS X
Just:
brew update
brew install vim
Restart terminal, and ensure you have +clipboard
in output of:
vim --version | grep clipboard
Then use + register to copy and paste code.
Bonus: read this tooltip by Jan about pasting from any register in Vim
Bonus 2: Make the system clipboard default register for yank.
Written by Adam Stankiewicz
Related protips
4 Responses
Did the update, it did not enabled clipboard when issuing 'brew install vim'.
Perhaps an option to configure ?
@niloct It did for me. Ensure which vim
is returning the correct binary.
I had to alter the Formula for brewing vim:
system "./configure", "--prefix=#{HOMEBREW_PREFIX}",
"--mandir=#{man}",
"--enable-gui=no",
"--without-x",
"--disable-nls",
"--enable-multibyte",
"--enable-clipboard",
"--with-tlib=ncurses",
"--enable-cscope",
"--with-features=huge",
*language_opts
system "make"
Notice the line which enables clipboard. After that brew was successful with +clipboard
Keep in mind if you use brew edit vim
you'll also need to use brew install -s vim
in order to build from source (possibly after a brew uninstall vim
to get rid of the bottle, otherwise you ALWAYS get the bottled
version which does NOT have +clipboard
.