vim save and quit

:q - quit (fails if there are changes)
:q! - force quit (! is for override, without writing)
:qa - quit all vim buffers
:wq - write and quit
:w - just write
:x - write and quit
ZZ - write the buffer and exit immediately
ZQ - quit without saving
:saveas newfile.txt - save the current contents at new file
:w! ~/newfile.txt - save the current contents at new file
:e ~/filename.txt - edit filename.txt