Vim for Windows - What do I type to save and exit from a file?

Solution 1:

Press ESC to make sure you are out of the edit mode and then type:

:wq

Solution 2:

Instead of telling you how you could execute a certain command (Esc:wq), I can provide you two links that may help you with VIM:

  • http://bullium.com/support/vim.html provides an HTML quick reference card
  • http://tnerual.eriogerg.free.fr/vim.html provides a PDF quick reference card in several languages, optimized for print-out, fold and put on your desk drawer

However, the best way to learn Vim is not only using it for Git commits, but as a regular editor for your everyday work.

If you're not going to switch to Vim, it's nonsense to keep its commands in mind. In that case, go and set up your favourite editor to use with Git.

Solution 3:

Esc to make sure you exit insert mode, then :wq (colon w q) or ZZ (shift-Z shift-Z).