I'm stuck and cannot escape. It says:
"type :quit<Enter> to quit VIM"
But when I type that it simply appears in the object body.
|
Hit the Esc key; that goes into command mode. Then you can type
When you press Or you can press Esc Or if you don't want to save changes you can use ZQ instead. Vim has extensive help, so type Esc |
|||||||||||||||||||||
|
|
Before you enter a command, hit the Esc key. After you enter it, hit the Return to confirm. Esc finishes the current command and switches Vim to command-line mode. Now if you press :, the Most commands have abbreviations, with optional part enclosed in brackets: Commands marked with '*' are Vim-only (not implemented in Vi). Safe-quit (fails if there are unsaved changes):
Prompt-quit (prompts if there are unsaved changes)
Write (save) changes and quit:
Discard changes and quit:
Press Return to confirm the command. This answer doesn't reference all Vim write and quit commands and arguments. Indeed, they are referenced in the Vim documentation. Vim has extensive built-in help, type Esc This answer was inspired by the other one, originally authored by @dirvine and edited by other SO users. I've included more information from Vim reference, SO comments and some other sources. Differences for Vi and Vim are reflected too. |
||||
|
|
|
If you want to quit without saving in vim and have vim return a non-zero exit code, you can use I use this all the time because I can't be bothered to pinky shift for |
|||||||||
|
|
To my knowledge, vim is unexitable. Buying a new computer solved the issue for me. |
|||||||||
|
|
In case you need to exit Vim in easy mode (while using |
|||||
|
|
EscEscEsc This in case you have no idea what you've done while attempting to exit, and you don't want to write anything to the files. It is possible that you enter e.g. insert mode, then visual mode and then operator pending mode and thus need to press Esc three times. (To try this, do However, that doesn't work if you have entered Ex mode. In that case you would need to do:
So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be
|
|||||
|
|
After hitting ESC (or cmd + C on my computer) you must hit : for the command prompt to appear. Then, you may enter You may find that the machine will not allow you to quit because your information hasn't been saved. If you'd like to quit anyway, enter ! directly after the quit (i.e. |
||||
|
|
|
I got Vim by installing a Git client on Windows. |
|||||||||
|
|
Press Escape then |
|||
|
|
|
So, I guess like me you are not into Vim and want to Just do the following
And we are back home :) |
|||||||||
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
:quitand then hit the[ENTER]key. – Farahmand Mar 4 '14 at 18:33nano(much easier to use and the hotkeys are always displayed at the bottom) – sjagr Nov 24 '14 at 20:03