quite vim and save code example
Example 1: save and close vim
// Save & exit(quit)
:wq
Example 2: vim save file
// Save a new file (if you have entered vim without first creating a file)
:w <filename>
// Save file and exit
:x
// Save & exit(quit)
:wq
// Save a new file (if you have entered vim without first creating a file)
:w <filename>
// Save file and exit
:x