In the past, the standard text editor shipped with every Unix system, be it BSD or Linux, was vi. Thank God this stoner-programmer nonsense has now been replaced by ee (EasyEdit) on FreeBSD and nano on Linux, which also come "out of the box".
However, oddly enough, vi is still included "out of the box" and, worst of all, some software continues to use it as its preferred editor (apparently due to the same kind of stoned programming behind that software). Another case is OSes that ship mega-bare (CentOS 6, for example), without even having nano. And in order to install some editor you can actually use, you sometimes need to edit a couple of config files first. But with what? You end up having to run the hated vi.
Here I've written a super-simple sequence for how to open a file, edit it, and close it in vi. Just to have some way out of the situation when there's no text editor at all on the system.
1) Open it - as usual:
$ vi textfile
2) Move using the arrow keys, or if those don't work:
k - Up
j - Down
h - Left
l - Right
3) Once you've reached the spot you need, use:
x - Delete character
i - Enter "insert" mode
a - Enter insert mode, where characters are placed after the cursor
4) After making changes - press ESC to return to "command" mode.
5) To save - press ":" and type "wq", then press Enter:
:wq
6) If it says that changes have not been saved since the last edit, and you're trying to quit with the ":quit" command, just add "!" at the end to ignore the warning.
Comments