Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Brew install Vim with +clipboard?

Tags:

vim

homebrew

I'm trying to figure out how to copy-and-paste between a file edited with Vim and the macOS Clipboard. Most instructions say to start by installing Vim using Homebrew as it will be installed with the clipboard option enabled (vim --version will display "+clipboard"). However, when I installed Vim using brew, the clipboard option was still set to "-clipboard". Can I force brew to reinstall Vim and turn this option on in the process? I'm using Homebrew 1.1.2 which installed VIM 7.4.

like image 703
Jim Avatar asked Mar 11 '23 11:03

Jim


1 Answers

Because Homebrew no longer takes package specific options on the command line you need to edit the formula to add support for the clipboard back and then tell brew to install from source and not from a bottle.

brew uninstall vim
brew edit vim
# Add `"--enable-clipboard",` after the `./configure` in the list of other options.
brew install -s vim

Summarized from this solution: https://coderwall.com/p/avmotq/gain-clipboard-support-for-vim-on-os-x

like image 139
dragon788 Avatar answered Mar 14 '23 23:03

dragon788