vim is actually an upgraded version of vi, vi where all commands can be used in vim, almost no difference for general use.
EDITORIAL: Can not exit and save after entering the vim editor, you can try sudo permissions to the file you want to edit (for example: sudo vim / file_path).
Press the letter "i" after the editor to enter the edit mode.
After editing, you want to exit, press the "Esc".
1, save and exit --shift + zz or: wq!
2, exit without saving -: q!
3, Force Quit - :!
4, the normal exit -: q
5. Edit wq + Delete
Exit to esc