Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacVim and Mercurial check-in

I'm trying to use MacVim as a default editor (on my Mac, obviously). I'd like to have MacVim to edit commit messages when I hg ci. Unfortunately when I do so (either by setting EDITOR=mvim or alias vi='mvim') MacVim pops up with an empty message (i.e. none of the boilerplate in the bottom half), and when I save that commit message I get the error "abort: empty commit message".

Is there a way to use MacVim (presumably via mvim) to edit the commit messages when checking in changes with Mercurial?

Thank you for reading, and I look forward to reading the answers.

Brian

like image 339
Brian M. Hunt Avatar asked Oct 28 '10 18:10

Brian M. Hunt


1 Answers

Set EDITOR='mvim -f', per the tip from the FAQ for making it work with Git:

How can I use MacVim to edit Git commit messages?

Add the following line to the file ~/.profile:

export EDITOR='mvim -f -c "au VimLeave * !open -a Terminal"'

The last part ensures that Terminal gets focus again after closing the commit message. (Note that you need to put the mvim script in your path for this to work.)

like image 176
Jeremy W. Sherman Avatar answered Oct 31 '22 04:10

Jeremy W. Sherman