How to Save & Quit in VIM or VI

Go to OSX Daily to read How to Save & Quit in VIM or VI

If you’re new to VI or VIM, the command line text editors, you may be wondering some of the basics, like how to save files, or how to both save and quit in vim in one fell swoop.

How to Save & Quit a File in VIM or VI

The simplest way to both save and quit out of VI or VIM is with a keyboard shortcut ZZ. Note the capitalization, which means the save and quit command is executed by pressing Escape, then holding the Shift key then pressing Z twice, thus:

  • Press the ESC key, then hold the Shift key then press Z twice

You’ll immediately save the current file…

Read more: How to Save & Quit in VIM or VI