The problem is that minor modes, in this case Evil, take precedence over the global keymap. One solution is to add the binding directly to evil-normal-state-map
, as in
(define-key evil-normal-state-map (kbd "C-p") 'helm-projectile)
You can do the same for the insert/visual/etc maps if you'd like.
Alternatively, you can use the bind-key*
macro from the bind-key
package (should already be installed if you use use-package
, Spacemacs, DOOM Emacs, etc.). The asterisk signifies that your binding will not be placed in the global keymap, but instead added to the keymap for bind-key
's own override-global-mode
(which lives inside emulation-mode-map-alists
, whose members take precedence over those in minor-mode-map-alist
... sneaky!). Usage is simple:
(bind-key* "C-p" 'helm-projectile)
Finally, you can use the great Swiss Army Knife of keybinding tools, general.el. Something like:
(general-define-key
:states '(normal insert)
:keymaps 'override
"C-p" 'helm-projectile)
This being Emacs, I'm sure there are a million other solutions.