One of the standard editors found on any UNIX system, vi, is a modal editor that provides many useful features. This section is not spacious enough to do justice to vi's many features, so only the basic commands needed to do simple editing will be covered here. A few of the more useful commands include:
Modal refers to the way that vi operates in different modes. When first invoked, vi is in command input mode. The cursor can be moved around the screen, but any other keys typed are expected to be commands. Some of those commands, like the i command, switch the editor into text input mode. For the insert command, the characters typed are inserted to the left of the cursor.
The escape key will return to command mode, either from text input mode or to abort a command in the middle. If you type several characters that do not create a command, no other command can be entered until these characters are cleared. The escape key returns to command input mode and clears the partial command.