all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'fpereiro'" <fpereiro@gmail.com>, <Help-gnu-emacs@gnu.org>
Subject: RE: Key rebindings: Turn off pgup-pgdown + move "hjkl" in Viper
Date: Mon, 21 Dec 2009 08:04:51 -0800	[thread overview]
Message-ID: <28E4BB459A8A418BA56365E3EACFD945@us.oracle.com> (raw)
In-Reply-To: <26859195.post@talk.nabble.com>

> 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.

Page Down is the `next' key. Page Up is the `prior' key.
Setting a key to nil removes any binding it might have had.

(global-set-key [next] nil)
(global-set-key [prior] nil)

Also, you need not quote a vector - vectors are self-evaluating:

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

> 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.

You can remap the commands, instead of defining the keys. That will move all
keys bound to a given command to another key, which you prefer. See the Elisp
manual, node `Remapping Commands'. As an alternative, see also function
`substitute-key-definition', in node `Changing Key Bindings'.

To get the command currently bound to a key, use function `lookup-key' (see node
`Functions for Key Lookup'). To find out the command bound to a given key
interactively, use `C-h k' (`describe-key').





      reply	other threads:[~2009-12-21 16:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-19 22:30 Key rebindings: Turn off pgup-pgdown + move "hjkl" in Viper fpereiro
2009-12-21 16:04 ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28E4BB459A8A418BA56365E3EACFD945@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=Help-gnu-emacs@gnu.org \
    --cc=fpereiro@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.