Insert Mode

Insert mode allows you to insert text into the file you are editing. There are several ways to enter insert mode depending on what you want to do. They are:
a
append text after current cursor position
i
insert text before the current cursor position
A
append text after end of current line
I
insert text at beginning of current line
o
open a line below the current line
O
open a line above the current line
It is usually easiest to use [i] to insert text. If, however, you want to add text to the end of a line, you have to use [A].

Once you have entered insert mode with any of the above commands you are able to continue typing and inserting text. "vi" will allow you to delete characters and edit within the current line you are editing but will not give you any other cursor positioning capabilities or editing functions beyond the ability to backup and delete characters and entered. In fact, if you try to use any of the cursor positioning keys, besides the [DEL] key or [CTRL-W] (used to backup over and delete words), while still in insert mode, you run the risk of losing portions of your text. Be certain that you are in command mode, not insert mode, when using the cursor positioning keys (please see the next section for a list of what these keys are).

If you need to do major editing on text, you can return to command mode by pressing the [ESC] key. You may now use all the cursor positioning commands and editing commands available in command mode.

Click here to go to the next section.

Or click here to go to the top of the chapter.