How To Exit Vim
How to quite Vim?
Well, there are multiple options.
That largely depends on whether you want to abandon the changes you made or save them.
First, press Esc
to get back to normal mode.
:qa!
to close all files and quit abandoning all the changes:wqa
to save all files and quitZZ
in normal mode writes the current file and exits:x
same as above
Learn more
There's not much more to it, but if you want, you can read help docs :help quit
, which is always a good idea.