Press the ESC
button to jump to command mode, then:
:w
-Save the file without exitingvim
.:w file
-Save the changes to thefile
middle without exitingvim
.:w!
-Force save, do not exitvim
.:wq
-Save the file and exitvim
.:wq!
-Force to save the file and exitvim
.:q
-Exit without saving the filevim
.:q!
-Do not save the file and force exitvim
.:e!
-Discard all changes and start editing from the last time the file was saved- Press enter to exit