Next: , Previous: , Up: Customisation  

Q3.5.5: Scrolling one line at a time.

Can the cursor keys scroll the screen a line at a time, rather than the default half page jump? I tend it to find it disorienting.

Try this:

(defun scroll-one-line-up (&optional arg)
  "Scroll the selected window up (forward in the text) one line (or N lines)."
  (interactive "p")
  (scroll-up (or arg 1)))

(defun scroll-one-line-down (&optional arg)
  "Scroll the selected window down (backward in the text) one line (or N)."
  (interactive "p")
  (scroll-down (or arg 1)))

(global-set-key [up]   'scroll-one-line-up)
(global-set-key [down] 'scroll-one-line-down)

The following will also work but will affect more than just the cursor keys (i.e. C-n and C-p):

(setq scroll-step 1)

You can also change this with Customize. Select from the Options menu Advanced (Customize)->Emacs->Environment->Windows->Scroll Step... or type M-x customize RET windows RET.