A long time ago, before I switched to vims, I used an editor for OS X known as TextMate. (Anyone remember that? ;)
Its command-line binary,
mate, allowed for a
mate -w flag, which would block the command-line binary exiting until the file was saved, and closed. This allowed for using
mate -w as the editor for
git commit-messages and similar.
Trying to do similar with MacVim (or gVim) doesn't work out; as the
mvim helper closes as soon as MacVim is launched (or as soon as the file is opened). This results in a “your message was empty,” or similar other error, from whichever program invoked the
$EDITOR: as far as the program knows, the ‘editor’ (the
mvim helper-binary) has exited, but the file it's provided to edit is still empty.
Is there some command, configuration setting, or hack that I could use to ensure the command-line
mvim helper (or whatever alternative alias or script you come up with for me) doesn't exit until the opened files have been saved and closed in MacVim?