Permutation: b and: e in the evil-normal state map

I cannot figure out how to recover the :b and :e commands in evil mode for Emacs. Google doesn't really help.

I tried (define-key evil-normal-state-map ":b" 'helm-buffers-list) , but it turns the key : to enter commands.

Currently I use (define-key evil-normal-state-map ",b" 'helm-buffers-list) and (define-key evil-normal-state-map ",e" 'find-file) , but I would rather have them on :b and :e , so when using real Vim the movements will be the same.

Do not specify reassignment to ,b and ,e in Vim. :-)

+8
emacs evil-mode
source share
1 answer

Okey, you need to (re) define evil-ex-define-cmd :

  • (evil-ex-define-cmd "b[uffer]" 'helm-buffers-list)
  • (evil-ex-define-cmd "e[dit]" 'find-file)

Except now they need <enter> after :<cmd> .

To the right , after you trawled a bit through the source, I found a solution:

  • (define-key evil-ex-map "b" 'helm-buffers-list)
  • (define-key evil-ex-map "e" 'find-file)

Now there is no <enter> after entering fe :b .

+13
source share

All Articles