how to quit vim without saving code example
Example 1: vim discard changes and quit command
Vim editor:
Insert: hit I key
Discard and exit: esc q!
Save and exit: esc qw
Example 2: vim save and quit
// Save & exit
:wp
Vim editor:
Insert: hit I key
Discard and exit: esc q!
Save and exit: esc qw
// Save & exit
:wp