I'm stuck in Vim and can't get out. I get the following message:
type :quit<Enter> to quit VIM
But when I write it, it appears in the text block. How do you get out of Vim then?
I'm stuck in Vim and can't get out. I get the following message:
type :quit<Enter> to quit VIM
But when I write it, it appears in the text block. How do you get out of Vim then?
Press the key Esc. This puts vim into command mode.
Then, you can type one of the following options:
:q
to get out (short version of:quit
):q!
to exit without saving (short version of:quit!
):wq
to write and quit (think write and quit):wq!
to write and exit even if the file has only read permission (if it doesn't have write permission, force writing):x
to write and exit (similar to:wq
, but don't write if there are no changes):qa
to exit all screens (short version of:quitall
)When you press
:
, a will appear:
at the bottom of the screen.For more Vim help, type in Esc
:help
Returnand you'll get all the answers in one neat tutorial.Commands starting with a colon are the most popular when exiting vim.
However, there are also a couple of commands that do not require a previous colon, although they do require being in normal mode (you have to press Escif you are in another mode). Those commands are:
ZZ
exit savingZQ
exit without saving