There are three modes used in the vi editor.
» Command mode
» Line mode
» Insert or Input mode
Command mode :
Vi is a command-driven editor. When you start a vi edit session, you are in command mode. Therefore, if you type any keys, vi will try to execute the associated commands. Almost every key on the keyboard is assigned to some vi function. Commands are available to input text, move the cursor, modify text, delete text, and paste text. Generally, vi commands are silent, which means that as you enter vi commands they will not be echoed to the screen. You will only see their effects.
Line Mode :
ex is an extended line-oriented editor, whose commands are available from within your vi edit session. ex commands are entered at the colon prompt, and unlike vi commands, are echoed to the screen and are submitted by entering a Return . These commands are commonly used for multi-line modifications and session customization.
Insert or Input mode :
There are vi commands available to get into the input mode, where everything you type will be entered into your file. To return to the command mode just press the Esc key.