vimvi

How do I exit Vim?


I am stuck and cannot escape. It says:

type :quit<Enter> to quit VIM

But when I type that it simply appears in the object body.


Solution

  • Hit the Esc key to enter "Normal mode". Then you can type : to enter "Command-line mode". A colon (:) will appear at the bottom of the screen and you can type in one of the following commands. To execute a command, press the Enter key.

    You can also quit Vim directly from "Normal mode" by typing ZZ to save and quit (same as :x) or ZQ to just quit (same as :q!). (Note that case is important here. ZZ and zz do not mean the same thing.)

    Vim has extensive help - that you can access with the :help command - where you can find answers to all your questions and a tutorial for beginners.