Friday, May 30, 2008

Emacs Tip #23: set-goal-column

M-x set-goal-column  (C-x C-n)

Emacs generally tries to maintain the same horizontal position for the
cursor as you move up and down in the buffer. However, you may want
to have it "remember" a particular position when perusing a data file
of some sort - perhaps when a certain column has particular interest.

C-x C-n does just that. It sets the current horizontal position as
the goal column. You can move around the buffer however you want, but
as soon as you use C-n or C-p, you're moved back to the goal column.

To unset, just use the universal prefix:

C-u C-x C-n

No comments: