Tim Hatch

Weblog | Photos | Projects | Panoramas | About

medit: using MacVim as $EDITOR 10 Sep, 2008

For my day-to-day editing on OS X, I’ve recently settled in with MacVim. I’ve tried several editors on OS X but have been unhappy due to parsing bugs (in the case of skEdit), forcing lots of whitespace (in the case of TextMate), or integration issues (vim, emacs, and pretty much every other editor, for various reasons). Vim in general can highlight way more source formats, and is a bit more customizable. The major downsides with vim were the difficulty in building it well and getting consistent unicode support (without getting into the syntax of the vim language itself).

Anyway, MacVim works great if you stick with the gui. If you need to use it from the command line (say, to edit a commit message from bzr, git, svn, or whatever) it needs to block until you’re done editing that file.

Here’s a quick hack that I did to the mvim script that comes with MacVim — all it does is assumes a .swp file gets created, and waits for it to go away.

Anyway, set $EDITOR=medit and save this file in your path under that name. medit

Available as part of my env bzr repository as well.