What is the best way to rebind common keys?

Michael Markert markert.michael at gmail.com
Tue Sep 23 21:02:56 CEST 2014


On Tue, Sep 23 2014 (14:11), Gordon Gustafson <gordon3.14 at gmail.com> wrote: 

> If you want to rewrite all the default bindings, I would edit the file
> evil-maps.el, which contains all the default mappings (it uses
> define-key).

I wouldn't recommend that approach.

Either you create a merge nightmare (if you use the repository) or
you'll just have to merge manually (also a nightmare, if you use an
ELPA) after each update.

If you want to extensively change the key maps, just reset the relevant
evil key maps, e.g.

     (setq evil-normal-state-map (make-sparse-keymap)
           evil-emacs-state-map (make-sparse-keymap)
           evil-motion-state-map (make-sparse-keymap)
           evil-visual-state-map (make-sparse-keymap))

If you don't care if the original bindings are still in use just define
the new keys.

Either way, there's no getting around `define-key'.

But evil-maps.el provides the definite listing of key bindings you are
looking for.

Michael



More information about the implementations-list mailing list