I\'m stuck and cannot escape. It says:
\"type :quit to quit VIM\"
But when I type that it simply appears in the object body.>
Vim has three modes of operation: Input mode, Command mode & Ex mode.
Input mode - everything that you type, all keystrokes are echoed on the screen.
Command mode or Escape mode - everything that you type in this mode is interpreted as a command.
Ex mode - this is another editor, ex. It is a line editor. It works per line or based on a range of lines. In this mode, a : appears at the bottom of the screen. This is the ex editor.
In order to exit Vim, you can exit while you are in either the ex mode or in the command mode. You cannot exit Vim when you are in input mode.
Exiting from ex mode
You need to be sure that you are in the Command mode. To do that, simply press the Esc key.
Go to the ex mode by pressing the : key
Use any of the following combinations in ex mode to exit:
:q
- quit
:q!
- quit without saving
:wq
- save & quit or write & quit
:wq!
- same as wq, but force write in case file permissions are readonly
:x
- write & quit
:qa
- quit all. useful when multiple files are opened like: vim abc.txt xyz.txt
Exiting from command mode
Press the escape key. You probably have done this already if you are in command mode.
Press capital ZZ (shift zz
) - save & exit
Press capital ZQ (shift zq
) - exit without saving.