Skip to main content
2 of 2
edited tags
Dan
  • 33.4k
  • 7
  • 106
  • 171

Disable default key binding in evil mode for evil leader

I'm using evil-leader and bind the leader key to <SPC>. Evil-leader config follows after evil-mode in .emacs file.

Problem: Sometimes when I hits <SPC>, it uses default forward char of evil-mode.

I added this line to unset the key.

(define-key evil-normal-state-map (kbd "SPC") nil)

It still doesn't help. So I M-x + evil-leader-mode every time the problem occur.

My full code is as below:

;; evil-mode
(evil-mode t)    

(require 'evil-leader)
(global-evil-leader-mode)
(setq evil-leader/in-all-states 1)
;; unbind evil dafault SPC of forward char
(define-key evil-normal-state-map (kbd "SPC") nil)
(evil-leader/set-leader "<SPC>")
(evil-leader/set-key
  "f" 'helm-find-files)