How do I exit Vim when doing a Mercurial commit at the command line?
:q[uit]
quits.
:w[rite]
saves.
:wq
is a shortcut for both
:!command
runs a command in a shell (you could use this to commit without having to leave Vim)
It's also useful to know that
:q!
exits vi without saving, and Mercurial interprets that as you abandoning the checkin. This can be useful if you're editing the commit message and suddenly realise there's something else you need to do.