How to Exit Vim

Yes, we all have been there: You are stuck and cannot escape Vim. It says:
"type :quit<Enter> to quit VIM"
Here is the solution to escape from this dead-end hell:
- Press
Esckey. - Hit
: - Press
wq(qshort for quit,wfor write/save) - Hit
Enter
If you dont want to save the changes you made in the file use q! instead of
wq.
For more
‘quit’ Alternatives
:xto write and quit (similar to:wq, but only write if there are changes):exitto write and exit (same as:x):qato quit all (short for:quitall):1,5wqwill save only lines 1 to 5 and quit
Shortcut Alternatives
After pressing Esc:
ZZwill save and quitZQwill just quit
All done!
Changelog
- 2020-10-30 : Added post image
Subscribe
Read Related