Function: evil-initialize

evil-initialize is a byte-compiled function defined in evil-core.el.

Signature

(evil-initialize)

Documentation

Enable Evil in the current buffer, if appropriate.

To enable Evil globally, do (evil-mode).

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-core.el
;; The function `evil-initialize' should only be used to initialize
;; `evil-local-mode' from the globalized minor-mode `evil-mode'. It is
;; called whenever evil is enabled in a buffer for the first time or
;; when evil is active and the major-mode of the buffer changes.
(defun evil-initialize ()
  "Enable Evil in the current buffer, if appropriate.
To enable Evil globally, do (evil-mode)."
  (if evil-local-mode
      ;; Set Evil state according to new major-mode
      (evil-initialize-state)
    (or (and (minibufferp) (not evil-want-minibuffer))
        (evil-disabled-buffer-p)
        (evil-local-mode))))