Emaps provides utilities for working with keymaps and keybindings in Emacs.
Emacs has a built-in define-key
function, but this can only handle one binding
at a time, for example:
(define-key keymap "a" 'fun-a)
(define-key keymap "b" 'fun-b)
(define-key keymap "c" 'fun-c)
; etc.
Emaps provides the emaps-define-key
function that provides the same
functionality, but allows multiple keys to be defined at once, thus the
above becomes:
(emaps-define-key keymap
"a" 'fun-a
"b" 'fun-b
"c" 'fun-c) ; etc.
Run M-x emaps-describe-keymap-bindings
to display the
bindings for a given keymap (see below),
emaps-describe-keymap
can be used to view keymaps as
variables (but with characters displayed instead of integers,
where possible). Executing these commands with a prefix
argument allows you to choose from only active keymaps.
I recommend the following bindings with Emaps (though I encourage you to experiment and find what works best for you):
Key | Command |
---|---|
C-h K | emaps-describe-keymap-bindings |
Which you can set with the following snippet:
(emaps-define-key global-map
(kbd "C-h K") 'emaps-describe-keymap-bindings)