Function: evil-save

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

Signature

(evil-save FILENAME &optional BANG)

Documentation

Save the current buffer to FILENAME.

Changes the file name of the current buffer to FILENAME. If no FILENAME is given, the current file name is used.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(evil-define-command evil-save (filename &optional bang)
  "Save the current buffer to FILENAME.
Changes the file name of the current buffer to FILENAME.  If no
FILENAME is given, the current file name is used."
  :repeat nil
  :move-point nil
  (interactive "<f><!>")
  (when (zerop (length filename))
    (setq filename (buffer-file-name (buffer-base-buffer))))
  (write-file filename (not bang)))