Vi
FAQ
How to Exit the Vi or Vim Editor
Press the
Esc
key a few times. This will ensure vi is out of Insert mode and in Command mode.Type
:q!
and pressEnter
. This tells vi to quit without saving any changes.(If you do want to save your changes, type
:wq
instead.)
Source: Dave McKay