Sep 21, 2018

How to exit vim/vi

press escape to enter "Master" mode
then type : to enter "Last Line" mode
then type q and hit enter.
This should exit. If it doesn't, repeat these steps using q! instead to force-quit.
If you want to save any changes you made to the file, you can add a w to these commands (w stands for "write"): wq or wq!