Quitting the editor is accomplished via command mode (press Esc if you aren't sure what mode you're in). From command mode, you can always quit by typing the ``colon'' command :q! (and pressing Enter). Many of the commands that operate on files begin with colon this way. For example :w file.txt writes everything to a file named file.txt, and :e file.txt loads file.txt and ``edits'' it.