Next: Erasing, Previous: Inserting Text, Up: Basic
To do more than insert characters, you have to know how to move point (see Point). The simplest way to do this is with arrow keys, or by clicking the left mouse button where you want to move to.
There are also control and meta characters for cursor motion. Some are equivalent to the arrow keys (these date back to the days before terminals had arrow keys, and are usable on terminals which don't have them). Others do more sophisticated things.
move-beginning-of-line
).
move-end-of-line
).
forward-char
). The right-arrow key
does the same thing.
backward-char
). The left-arrow
key has the same effect.
forward-word
).
backward-word
).
next-line
). This command
attempts to keep the horizontal position unchanged, so if you start in
the middle of one line, you end in the middle of the next. The
down-arrow key does the same thing.
previous-line
). The up-arrow key
has the same effect.
move-to-window-line
). Text does not move on the screen.
A numeric argument says which screen line to place point on. It counts
screen lines down from the top of the window (zero for the top line). A
negative argument counts lines from the bottom (−1 for the bottom
line).
beginning-of-buffer
). With
numeric argument n, move to n/10 of the way from the top.
See Arguments, for more information on numeric arguments.
end-of-buffer
).
scroll-up
). This doesn't always move
point, but it is commonly used to do so. If your keyboard has a
<PAGEDOWN> or <PRIOR> key, it does the same thing.
Scrolling commands are further described in Scrolling.
scroll-down
). This doesn't always move point, but
it is commonly used to do so. If your keyboard has a <PAGEUP> or
<NEXT> key, it does the same thing.
set-goal-column
). Henceforth, those
commands always move to this column in each line moved into, or as
close as possible given the contents of the line. This goal column remains
in effect until canceled.
If you set the variable track-eol
to a non-nil
value,
then C-n and C-p, when starting at the end of the line, move
to the end of another line. Normally, track-eol
is nil
.
See Variables, for how to set variables such as track-eol
.
C-n normally stops at the end of the buffer when you use it on
the last line of the buffer. But if you set the variable
next-line-add-newlines
to a non-nil
value, C-n on
the last line of a buffer creates an additional line at the end and
moves down onto it.