More Ways to Insert Text
You have inserted text before the cursor with the sequence:
itext to be inserted ESCYou’ve also inserted text after the cursor with the a command. Here are some other insert
commands for inserting text at different positions relative to the
cursor:
AAppend text to end of current line.
IInsert text at beginning of line.
o(lowercase letter “o”)Open blank line below cursor for text.
O(uppercase letter “o”)Open blank line above cursor for text.
sDelete character at cursor and substitute text.
SDelete line and substitute text.
ROverstrike existing characters with new characters.
All of these commands place you in insert mode. After inserting text, remember to press ESC to return to command mode.
A (append) and
I (insert) save you from having to
move your cursor to the end or beginning of the line before invoking
insert mode. (The A command saves
one keystroke over $a. Although one
keystroke might not seem like much of a saving, the more adept—and
impatient—an editor you become, the more keystrokes you will want to
omit.)
o and O (open) save you from having to insert a
carriage return. You can type these commands from anywhere within the
line.
s and S (substitute) allow you to delete a
character or a whole line and replace the deletion with any amount of
new text. s is the equivalent of
the two-stroke command cSPACE, and S is the same as cc. One of the best uses for s is to change one character to several
characters.
R (“large” replace) is useful when you want to start ...