Function: magit-blob-mode

magit-blob-mode is an interactive and byte-compiled function defined in magit-files.el.

Signature

(magit-blob-mode &optional ARG)

Documentation

Enable key bindings, which are useful in blob-visiting buffers.

This is a minor mode. If called interactively, toggle the Magit-Blob mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate magit-blob-mode(var)/magit-blob-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

C-x C-q magit-blob-mode(var)/magit-blob-mode(fun)
b magit-blame-addition
f magit-blame-reverse
g revert-buffer
n magit-blob-next
p magit-blob-previous
q magit-bury-or-kill-buffer
r magit-blame-removal
When the user disables read-only-mode, these bindings would conflict with bindings for self-insert-command. To avoid this conflict, read-only-mode is remapped to magit-blob-mode(var)/magit-blob-mode(fun) and disabling the latter disables both modes. Likewise, enabling it, also enables read-only-mode.

When this mode is disabled, many of the commands, for which it would single-character bindings, are accessible via C-c M-g (magit-file-dispatch).

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-files.el
(define-minor-mode magit-blob-mode
  "Enable key bindings, which are useful in blob-visiting buffers.

\\{magit-blob-mode-map}
When the user disables `read-only-mode', these bindings would conflict
with bindings for `self-insert-command'.  To avoid this conflict,
`read-only-mode' is remapped to `magit-blob-mode' and disabling the
latter disables both modes.  Likewise, enabling it, also enables
`read-only-mode'.

When this mode is disabled, many of the commands, for which it would
single-character bindings, are accessible via \\[magit-file-dispatch]."
  :package-version '(magit . "2.3.0")
  ;; Don't actually call `read-only-mode'.  Because
  ;; that could enable the incompatible `view-mode'.
  (setq-local buffer-read-only magit-blob-mode)
  (setq-local read-only-mode--state magit-blob-mode))