[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Key rebindings: Turn off pgup-pgdown + move "hjkl" in Viper

From: fpereiro
Subject: Key rebindings: Turn off pgup-pgdown + move "hjkl" in Viper
Date: Sat, 19 Dec 2009 14:30:30 -0800 (PST)

Hi there! I got stuck in doing a couple of key rebindings in Emacs and Viper
- noob as I am. Here's the thing:

1) I'm trying to render useless the Page Up and Page Down keys, so I'll get
used to navigate with proper commands around the editor. I could manage to
do this for most of the keys I wanted to "shut down" (say, the arrow keys)
by associating them to mark-whole-buffer, a fairly innocuous command. For
example, for the up arrow key, I inserted the following line on my .emacs

(global-set-key (quote [up]) 'mark-whole-buffer)

The problem is that I don't know how to refer to the Page Up and Page Down
keys. I've tried [pageup], [PageUp], [page up], [Page Up], and quite a few
more, but none seemed to work.

2) I'm trying out Viper (heresy is not a crime, you know) and want to remap
the "hjkl" cursor commands to "jkl;", so that my fingers can stay on the
initial keyboard positions. I could swap "hjkl" to "jkl;" by inserting the
following on my .viper file:

(define-key viper-vi-global-user-map "j" 'viper-backward-char)
(define-key viper-vi-global-user-map "k" 'viper-next-line)
(define-key viper-vi-global-user-map "l" 'viper-previous-line)
(define-key viper-vi-global-user-map ";" 'viper-forward-char)

What I'm still lacking is the command to swap the functionality previously
held by ";" to "h". Specifically, I would need to find out the name of the
viper function associated with ";". I know it's a line command, but couldn't
find the name of the function anywhere.

View this message in context:
Sent from the Emacs - Help mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]