Closed BooAA closed 6 years ago
Try running (evil-normalize-keymaps)
right after binding SPC
.
If you mean adding (evil-normallize-keymaps)
right after evil-define-key
, I have tried, but it doesn't work.
Run it in the message buffer manually and see if that fixes it. If it does you can do that in your init with something like with-current-buffer
.
Great! That fixes the problem.
Out of curiosity, can you tell me why only the startup message buffer have this issue? It's so strange that a minor mode has been activated but it's keymap doesn't. I want to understand this.
BTW, do you recommend using evil-escape to escape everything? Another question, I started using evil-collection yesterday, do you think using the evil-collection-setup-minibuffer feature will be a better choice than using hydra in minibuffer?( personally I use ivy with hydra-ivy, I'm wondering whether using evil-collection for minibuffer can give me more consistency.
It's probably because the message buffer exists even before evil loads. Evil's keymaps aren't really comparable to normal minor mode keymaps.
Edit: To better clarify, the message buffer existing so early may have something to do with it, but this is an issue in general. it's not just a matter of evil-mode being active. Evil's auxiliary maps are actually made in the regular minor and major mode keymaps; they just have no meaning normally and are handled specially by evil.
I don't recommend using evil-escape at all unless you don't have a good key available for escape. I'm guessing that evil-escape has the same issues as key-chord (i.e. that it will accidentally trigger if there is input lag/slow down and that you can only use it in Emacs). I think it's much better to use a dedicated thumbkey (or capslock). For example, I have right alt bound to my altgr layer when held and to escape when immediately released.
Since most evil keybindings aren't usable in the minibuffer, I think that hydra-ivy
is fine/preferable. You can try both out and see which you like better. I don't use a modal minibuffer that often and generally prefer using modifiers in the minibuffers personally.
In order to make SPC as my leader key globally, I used the method you provided,
Everything works well, the only exception is the message buffer shown when emacs startup.(at other times, message buffer works fine, and the startup scratch buffer works fine too)
I have checked the enable mode list by C-h m, my-intercept-mode has been activated correctly, but SPC doesn't bind to my-cmd-map but evil-forward-char.
If I press C-z twice to activate normal-mode again, then it can work properly, which is very strange.