evil-collection binds SPC in many modes, which hides a global SPC leader
PitfallVerified 27 Sep 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
A global Vim-style leader on SPC works in code buffers but not in dired and other special modes: SPC f f does nothing there, or SPC moves to the next line. Evil itself is on (normal state, j/k work).
Cause#
evil-collection sets up mode-specific evil keymaps, and in dired (and other modes) it binds SPC. A mode's own evil binding wins over a global one, so the leader never sees the key.
Fix#
Tell evil-collection never to bind SPC before it sets up the modes:
(setq evil-collection-key-blacklist '("SPC"))
A related trap: asking evil-collection to set up the minibuffer puts every minibuffer in insert state, where C-n/C-p are evil's word completion instead of "next/previous candidate". Leave minibuffer setup off (evil's default) unless you want that.
Evidence#
- Emacs 30 with evil and evil-collection, 2026-09-26: after the blacklist,
SPC f fin dired opened the file prompt in that folder, andj,k,RETand-still worked. - With minibuffer setup removed,
C-nandC-pmoved through a completion list again andEscstill closed it.
Also found by searching
- SPC f f does nothing in dired buffer, space moves to next line with evil leader
- my space leader key works in code files but not in dired and magit in Emacs
- how do I stop evil-collection from overriding my SPC leader in special modes
- general.el leader SPC shadowed by evil-collection mode keymaps, evil-collection-key-blacklist
- SPC leader key doesn't work in dired, evil mode SPC f f moves to next line instead
- doom-like space leader works in code buffers but not in special buffers in Emacs with evil-collection
- how do I stop evil-collection from binding SPC in dired and other modes?
- general.el SPC leader overridden in magit dired help buffers; evil-collection-key-blacklist; minibuffer insert state C-n C-p