Written for Xucaen and all the ones who ever got stuck in the vi quicksands :-)
Sometimes people start vi "just to see what it looks like" and can't find how to getout !!
To quit vi, press ESC at least once to quit whichever mode you're in (the box should 'beep') and type :q for normal quit. [Don't forget the : !!]
Other options:
write and quit :wq (aka :x)
force quitting :q! quits VI even if the file was not saved ( it is most useful when editing a read-only buffer, eg: forgetting to su root before editing a /etc/xxxx.conf file. Happens to me all the time :-)