I honestly get confused when I’m using VI since I prefer to use Nano or Pico. So these notes are to help me when I’m somehow “trapped” using VI.
First, if you are in VI itself, you need to use “insert mode” to edit something:
s: Insert mode.
esc: Escape out of insert mode.
:: Enter command mode.
And when you are done, just hit
esc to escape out of insert mode.
Now if you want to exit, enter “command mode” by typing
: and choose one of the following:
wq: Write and quit at the same time.