Here's how to edit a Homebrew formula:
brew edit formula
So, in your case that'd be brew edit vim
. Save, and reinstall. The edited formula is cached locally until you update Homebrew—if I recall correctly, you'll be asked what to do with your changed formula once you update Brew.
You could even go as far as creating your own formula though, which is explained in the Formula CookbookFormula Cookbook. The basic steps are:
- Create a tarball for your software and call
brew create
for that URL e.g.brew create http://example.com/foo-0.1.tar.gz
- Build it with
brew install -vd foo
, where debugging and verbose mode is on