Linux vim save command
ESC key jumps to command mode
Then:
W Save the file without exiting vi
W file saves the changes to file and does not exit vi
: w! Forced save, do not launch vi
Wq saves the file and exits vi
: wq! Force to save the file and exit vi
Q: quit vi without saving the file
: q! Do not save the file, force to exit vi
: e! Discard all changes and edit since the last time the file was saved