avmotq
Last Updated: February 25, 2016
·
2.713K
· sheerun
Photo on 08.01.2013 at 04.15

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.

Say Thanks
Respond

3 Responses
Add your response

3476

Did the update, it did not enabled clipboard when issuing 'brew install vim'.

Perhaps an option to configure ?

over 1 year ago ·
3646
Photo on 08.01.2013 at 04.15

@niloct It did for me. Ensure which vim is returning the correct binary.

over 1 year ago ·
3716

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

over 1 year ago ·