     key=>def pair.
 
     If states are omitted the keybind will be global.
+
+    This can be customized with `doom-evil-state-alist'.
 
     :L cannot be in a :map.
 

  (which-key-mode +1))


(defun doom-keybind-register (key desc &optional modes)
  "TODO"
  (if modes
      (dolist (mode modes)
        (which-key-add-major-mode-key-based-replacements mode key desc))
    (which-key-add-key-based-replacements key desc)))


(defun doom-keyword-to-states (keyword &optional ignore)
  "TODO"
  (let ((states '(("n" . normal)
                  ("v" . visual)
                  ("i" . insert)
                  ("e" . emacs)
                  ("o" . operator)
                  ("m" . motion)
                  ("r" . replace))))
    (delq nil
          (mapcar (lambda (l)
                    (let ((state (cdr (assoc l states))))
                      (unless state
                        (unless (or (eq ignore t) (member l ignore))
                          (error "not a valid state: %s" l)))
                      state))
                  (split-string (substring (symbol-name keyword) 1) "" t)))))

;; Register keywords for proper indentation (see `map!')
(put ':prefix       'lisp-indent-function 'defun)

;;; core-keybinds.el

;; A centralized keybinds system, integrated with `which-key' to preview
;; available keys, and `evil', if it's enabled. All built into one powerful
;; macro: `map!'.

(defvar doom-leader-key ","
  "The leader prefix key, for global commands.")
