The easiest way to disable editing in LyX is to
View > Toolbars > Command buffer (or simply alt+x, and in the command buffer executing
To make the document editable again you need to redo the above.
If you do this often, then it would be easier to define a new menu entry (see related bug report). Proceed as follows (on Linux):
~/.lyx/ui/stdmenus.inc find the line containing
Right after that line insert:
Item "Disable Editing|E" "buffer-toggle-read-only"
Save config file and restart LyX
This adds a
Document > Disable Editing menu item, toggled off by default, which can be toggled on to disable the editing of the current file.
As pointed out in the comments, alternatively one can add a keyboard shortcut. It's easier to set up because you can do it in LyX. In
Tools > Prefs > Editing > Shortcuts click on
New and put
Function field and for the shortcut you could choose, say, F8. Now you can use F8 to toggle on/off the
read-only status of the currently edited file.
read-only status of the currently edited file applies only to the current buffer within LyX. It does NOT affect the file-system properties of the file (i.e. you can still
rm the file even if you toggled it as
read-only while editing it in LyX).