MPE/iX Shell and Utilities Reference Manual, Vol 2

vi(1) MPE/iX Shell and Utilities vi(1)
Inserting Text
vi supports the following commands for inserting text:
A enters insert mode at end of line. This is equivalent to the $a command.
a enters insert mode after the current cursor position.
I enters insert mode before first non-blank character on line. This is equivalent to the ˆi
command.
i enters insert mode before the current cursor position.
O opens up a new line before the current line and enters insert mode on it.
o opens up a new line after the current line and enters insert mode on it.
R replaces characters on the screen with characters typed up to the next
ESC. Each
character typed overlays a character on the screen. The newline character is an ex-
ception; it is simply inserted and no other character is replaced. While you are doing
this, the screen may not correspond exactly to the contents of the file, due to tabs, etc.
The screen is properly updated when you leave insert mode.
r replaces the character under the cursor with the next character typed. When count is
given, count characters following the cursor are all changed to the next character
typed. If count is given and the newline character is the replacement character, count
characters are deleted (as usual) and replaced with a single newline character, not
count newlines.
Miscellaneous
J joins count lines together. If you do not specify count or count is less than 2, vi uses
a count of 2, joining the current line and the next line. This command supplies ap-
propriate spacing: one space between words, two spaces after a period, and no spaces
at all when the first character of the next line is a closing parenthesis ()). When a
line ends with white space, vi retains the white space, does not add any further
spaces, and then appends the next line.
P puts buffer contents before the cursor. This is also called a paste operation. If pre-
ceded by quote buffername (for example, "b), the contents of that buffer are used;
otherwise the contents of the unnamed buffer are used. If the buffer was created in
Ex mode, the contents of the buffer are inserted before the current line. If the buffer
was created in Vi mode, the contents are inserted before the cursor. As a special
case, if a paste operation is repeated with the period (.) command and it used a num-
bered buffer, the number of the buffer is incremented. Thus, "1p....., pastes in the
contents of buffer 1 through buffer 6; in other words the last six things that were
deleted are put back.
1-656 Commands and Utilities