Survival: Open, Edit, Save, Quit

The Survival Sequence

This is the whole game. Memorize this one flow and you can edit any file anywhere:

  1. Open: vim notes.txt
  2. Insert mode: press i - now type normally
  3. Stop typing: press Esc (back to Normal)
  4. Save & quit: type :wq then Enter

The command-mode escape hatches (from Normal, after Esc):

Type thisResult
:wWrite (save), stay open
:qQuit (only if no unsaved changes)
:wq or :xSave and quit
:q!Quit and throw away changes
Danger: :q! discards everything since your last save. It's your "get me out, I don't care" button - powerful, but don't use it out of habit or you'll lose real work.
$ vim hello.txt
# press i, type: Hello Linux
# press Esc, type :wq and Enter
$ cat hello.txt
Hello Linux
Goal: In the terminal below: create a file with vim, type a line, save it with :wq, and confirm with cat. That single loop is 90% of daily editing.