Function: evil-show-file-info

evil-show-file-info is an interactive and byte-compiled function defined in evil-commands.el.

Signature

(evil-show-file-info)

Documentation

Show basic file information.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(evil-define-command evil-show-file-info ()
  "Show basic file information."
  (let* ((nlines   (count-lines (point-min) (point-max)))
         (curr     (line-number-at-pos (point)))
         (perc     (if (> nlines 0)
                       (format "%d%%" (* (/ (float curr) (float nlines)) 100.0))
                     "No lines in buffer"))
         (file     (buffer-file-name (buffer-base-buffer)))
         (writable (and file (file-writable-p file)))
         (readonly (if (and file (not writable)) "[readonly] " "")))
    (if file
        (evil-echo "\"%s\" %d %slines --%s--" file nlines readonly perc)
      (evil-echo "%d lines --%s--" nlines perc))))