How to save and quit Vim
There's a joke around the internet that it's impossible to quit [[Vim]], but we'll see that it's actually not that hard. First of all, make sure that you're in normal mode. If you haven't changed any settings, you'll get to normal mode by pressing
Esc
. From here you can use any of the following commands::q
- quit (short for :quit
):q!
- quit without saving:qa
- quit all:wq
- write (save) and quit:wq!
- write and quit even if the file is in read only mode:x
- write and quit (only writes if there are changes)ZZ
- same as :x
All together that would for instance be:
Esc:q
ID: 210609194733