There are multiple ways of
Quitting without saving any changes
: starts the command,
q means “quit”,
a means “all” (all buffers/tabs/files), and finally,
! says “don’t care if there are any changes”. You can omit the exclamation mark, in this case if you have some unsaved changes, VIM will force you to save first.
Quitting and saving the changes
Again, make sure you are in the normal mode by
w means “write” as in write to disk. So before exiting the
Where to go from there
- Do you know how to copy and paste a line in Vim?
- If you need to know more, there’s a pretty good help within Vim itself. Type
:help quitin normal mode to access the documentation.