Search code examples
mercurialterminalcommitvi

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


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.


Solution

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