views:

33

answers:

3

I'm on a mac running 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 control+c shows me instructions that say typing "quit" will write and quit, but it doesn't seem to work.

+1  A: 

:q[uit] quits.

:w[rite] saves.

:wq is a shortcut for both

:!command runs command in a shell (you could use this to commit without having to leave vim)

zebediah49
thanks! I wasn't typing ":"meh....
Kenny Saunders
A: 

After you hit "Esc" to exit insert mode you could also type "ZZ" which will write your file to disk and quit.

Allen
A: 

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.

Norman Gray