View: Toggle Read-Only (View Mode)

view.toggleReadOnly

Make the buffer read-only or editable.

How to run it

Open the command palette (M-x in the Emacs keymap) and search for View: Toggle Read-Only (View Mode), then press Enter. It also has a default keybinding:

Emacs C-xC-q

Details

Read-Only (View) mode locks a buffer so it can’t be edited by accident. Typing and the edit commands are blocked, while highlighting, folding, search, and copy keep working, so it’s meant for reading rather than the huge-file safety limit.

A file that isn’t writable on disk opens in this mode automatically, and the per-file state is remembered between sessions.

While a buffer is read-only:

See Editing for the full picture.

See also