Alex Rivera | Logout

How do I exit Vim when doing a Mercurial commit at the command line?

Asked 2010-06-28T22:36:08.640
26

I'm on a Mac running OS X v10.6 (Snow Leopard). I have Mercurial 1.1 installed.

After I hit Esc to exit insert mode I can't figure out how to save and quit. Hitting Ctrl + C shows me instructions that say typing "quit" will write and quit, but it doesn't seem to work.

Edit
Report

1 Answer

44

: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)

answered 2010-06-28T22:39:18.523

Your Answer