 (general-define-key :states '(normal visual motion replace) doom-leader-key 'doom-leader)
 (general-define-key :states '(emacs insert) doom-leader-alt-key 'doom-leader)
 
-(defun general-leader-define-key (_state _keymap key def orig-def _kargs)
-  (let (general-implicit-kbd)
-    (general-define-key
-     :keymaps 'doom-leader-map
-     :wk-full-keys nil
-     key orig-def)))
+(general-create-definer define-leader-key!
+  :wk-full-keys nil
+  :keymaps 'doom-leader-map)
 
 ;; <localleader>
-(defun general-localleader-define-key (state keymap key _def orig-def kargs)
-  (unless keymap
-    (signal 'wrong-type-argument (list 'keymapp keymap)))
-  (let (general-implicit-kbd)
-    (apply #'general-define-key
-           :major-modes t
-           :keymaps keymap
-           (append
-            ;; :non-normal-prefix isn't respected when evil is absent, so this
-            ;; is necessary:
-            (if (featurep 'evil)
-                (list :states '(normal visual motion)
-                      :prefix doom-localleader-key
-                      :non-normal-prefix doom-localleader-alt-key)
-              (list :prefix doom-localleader-alt-key))
-            (list key orig-def)
-            nil))))
+(general-create-definer define-localleader-key!
+  :major-modes t
+  :keymaps 'local
+  :prefix doom-localleader-alt-key)
+
+;; Because :non-normal-prefix doesn't work for non-evil sessions (only evil's
+;; emacs state), we must redefine `define-localleader-key!' once evil is loaded
+(after! evil
+  (general-create-definer define-localleader-key!
+    :major-modes t
+    :keymaps 'local
+    :prefix doom-localleader-key
+    :non-normal-prefix doom-localleader-alt-key))
 
 
 ;;

  (let ((plist
         (append (list :prefix (doom--map-append-keys :prefix)
                       :non-normal-prefix (doom--map-append-keys :non-normal-prefix)
                       :definer (plist-get doom--map-parent-state :definer)
                       :keymaps
                       (append (plist-get doom--map-parent-state :keymaps)
                               (plist-get doom--map-state :keymaps)


;; specials
(defvar doom--map-forms nil)
(defvar doom--map-fn 'general-define-key)
(defvar doom--map-batch-forms nil)
(defvar doom--map-state '(:dummy t))
(defvar doom--map-parent-state nil)
