Prefer evil-normal-state-local-map or evil-define-key evil-normal-state-map ?

Frank Fischer frank-fischer at shadow-soft.de
Sun Jan 31 15:19:53 CET 2016


On 25.01.2016 07:30, Shiyao Ma wrote:
> 1. use evil-normal-state-map
> 
> 2. evil-define-key evil-normal-state-map
>
> ...
>
> So my question is, regarding my purpose, which method is better (not
> functionality-wise, but just best practice) ?

I think most people use 2. because it's easier to use and more to the
point: you just declare that you want some binding for normal state in a
buffer that uses this "package". The first variant typically requires
you to write a mode-hook (which is the more traditional Emacs way) that
installs your bindings in `evil-normal-state-local-map`.

Personally, I always prefer 1., but the reason is that I somehow know
about the implementation and problems with 2. (the implementation is
rather tricky and there are some long-standing bugs that are very
difficult to solve -- although there has been some work recently -- and,
to be honest, I would like to remove 2. from Evil completely, but this
would break the configurations of many users *sigh*)

Frank





More information about the implementations-list mailing list