Skip to content

Commit

Permalink
feat: allow setting evil states for leader keys
Browse files Browse the repository at this point in the history
This allows adjusting the evil-states a leader key is active for.
  • Loading branch information
TheJJ committed Feb 14, 2024
1 parent 8651651 commit 3060e52
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lisp/doom-keybinds.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"An alternative leader prefix key, used for Insert and Emacs states, and for
non-evil users.")

(defvar doom-leader-key-states '(normal visual motion)
"which evil modes to activate the leader key for")

(defvar doom-leader-alt-key-states '(emacs insert)
"which evil modes to activate the alternative leader key for")

(defvar doom-localleader-key "SPC m"
"The localleader prefix key, for major-mode specific commands.")

Expand Down Expand Up @@ -212,8 +218,8 @@ localleader prefix."
((equal doom-leader-alt-key "C-x")
(set-keymap-parent doom-leader-map ctl-x-map)))
(define-key map (kbd doom-leader-alt-key) 'doom/leader))
(evil-define-key* '(normal visual motion) map (kbd doom-leader-key) 'doom/leader)
(evil-define-key* '(emacs insert) map (kbd doom-leader-alt-key) 'doom/leader))
(evil-define-key* doom-leader-key-states map (kbd doom-leader-key) 'doom/leader)
(evil-define-key* doom-leader-alt-key-states map (kbd doom-leader-alt-key) 'doom/leader))
(general-override-mode +1))))


Expand Down

0 comments on commit 3060e52

Please sign in to comment.