How do you move the pointer up or down multiple lines with Emacs?
Posted
by Peter
on Stack Overflow
See other posts from Stack Overflow
or by Peter
Published on 2010-04-17T06:57:33Z
Indexed on
2010/04/17
7:03 UTC
Read the original article
Hit count: 252
I can move my pointer up and down one line with my arrow key just fine in Emacs, so I'd like to redefine C-n and C-p to move up and down 5 lines at a time.
I'm just beginning to learn how to use Emacs, and elisp is very alien to me. I tried using the GNU Emacs lisp reference, but I couldn't find how to bind a keystroke to multiple commands.
Here's what I have so far (concentrating on the moving up definition):
(global-set-key "\C-p" '(loop for i in '(1 2 3 4 5) do ('previous-line)))
But, this brings up an error message when I hit C-p, "Wrong type argument."
Any suggestions?
Thanks!
© Stack Overflow or respective owner