The version of Vim that comes with OS X is a little old, but more importantly, it doesn’t have all the bells and whistles enabled.
Specifically, it doesn’t come with ruby and python support compiled in. Which is a shame, because some plugins for Vim need it.
I’ve been playing with Vim since a couple months ago when I was pair programming with a co-worker, Shawn. Shawn prefers Vim and he is very good at it.
To make pair programming easier, I decided to improve my very basic Vim
skills. As part of that, I created a new
.vimrc based on Shawn’s. I then
went further and included Vundle and
started looking at various packages.
We used this
.vimrc during our pair programming and pushed it up as a
Homedir package at
http://github.com/docwhat/homedir-vim. I’ve successfully used this
on Windows (via Cygwin) and Centos version 5.6 and 6.2, as well as on the Mac.
You can bypass Homedir entirely and just
However, to use some of the spiffy bits of my
.vimrc on my Mac, I needed a
Vim with all the extras. Here’s how you do it easily:
- Install Homebrew.
- Add the “duplicates tap”.
This adds formulas for apps that duplicate the build-in OS X
brew tap homebrew/dupes
- Install Vim:
brew install homebrew/dupes/vim
That’s it. Easy-peasy!
Thanks for the tip. I had to use the fully-qualified recipe name, i.e.
brew install homebrew/dupes/vim, not sure if this is a general brew thing or
something particular to my setup.
Thanks for pointing that out. I fixed it above.
Tell me, have you or your coworker found a way to get the key bindings on the OS X version of Vim to match that of those on Linux? I love Vim but have the hardest time not getting frustrated with the OS X bindings.
I’m not sure what you mean by key bindings being different. I use the .vimrc mentioned above and it behaves the same for me on Linux and OS X.
Ah, sorry, I was referring to the control+left / control+right key bindings which makes moving between words significantly easier. However, if you’re on OS X, usually you can use option in place of control but apparently not in the OS X version of Vim.
I don’t use those keys. I use b or B and w or W to move around. So I guess I didn’t notice.
You can use the System Preferences to remap the control arrows. If that helps.