Function: evil-invert-case

evil-invert-case is an interactive and byte-compiled function defined in evil-commands.el.

Signature

(evil-invert-case BEG END &optional TYPE)

Documentation

Invert case of text.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(evil-define-operator evil-invert-case (beg end type)
  "Invert case of text."
  (if (eq type 'block)
      (evil-apply-on-block #'evil-invert-case beg end nil)
    (save-excursion
      (goto-char beg)
      (while (< beg end)
        (let ((char (following-char)))
          (delete-char 1)
          (insert-char
           (if (eq (upcase char) char) (downcase char) (upcase char))))
        (setq beg (1+ beg))))))