Function: evil-keymap-for-mode

evil-keymap-for-mode is a byte-compiled function defined in evil-core.el.

Signature

(evil-keymap-for-mode MODE &optional VARIABLE)

Documentation

Return the keymap associated with MODE.

Return the keymap variable if VARIABLE is non-nil. See also evil-mode-for-keymap.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-core.el
(defun evil-keymap-for-mode (mode &optional variable)
  "Return the keymap associated with MODE.
Return the keymap variable if VARIABLE is non-nil.
See also `evil-mode-for-keymap'."
  (let* ((var (or (cdr (assq mode evil-global-keymaps-alist))
                  (cdr (assq mode evil-local-keymaps-alist))))
         (map (or (symbol-value var)
                  (cdr (assq mode minor-mode-map-alist)))))
    (if variable var map)))