Java Reference
In-Depth Information
There are several ways to get into input mode, depending on where you
want to do the insert. When the file you're editing is completely empty, all
these commands are equivalent, but for nonempty files, each command will
begin input mode in a different place in the file:
i inserts before the cursor.
I inserts at the beginning of the line.
a appends after the cursor.
A appends at the end of the line.
o “opens” a line for input after the line on which the cursor sits.
O “opens” a line for input before the line on which the cursor sits.
Remember that this is character-based editing, before the days of mice and
I-bars. So there is no meta-character for the cursor to show its position between
two characters in the file. Instead, the cursor sits on top of a character, and thus
inserts or appends will happen before or after that character.
Reminder: Get out of input mode by pressing the Escape key.
Next, let's move the cursor around. The simplest way to do that is one
character at a time. Using the (lowercase) h , j , k , and l keys—notice that
they're all in a row on QWERTY keyboards—you have the “arrow” keys for
left, down, up, and right. One of the common enhancements for vi clones is
to include support for the arrow keys on standard PC keyboards. Even so, the
convenience of having the motion keys on the “home row” for touch typists
can be a great speedup.
h moves left one character.
j moves down one line.
k moves up one line.
l moves right one character; same as a space.
Often, character- or line-at-a-time is too slow. Move to the beginning of
the line that you are on with 0 (zero), or to the end of the line with $ . Move
to the top and bottom of the window with H (think “High”) and L (think
“Low”). So first type L then hold down j . To move back in a file, first type H
then hold down k . That gets the display moving down or up respectively.
H (“high”) moves to the top line of the window.
M (“middle”) moves to the middle line of the window.
Search WWH ::




Custom Search