In IntelliJ IDEA, I am sometimes opening files from outside the project, and want to protect them against my accidental changes.
Is it possible to toggle the editor to read-only mode? They have the Reader mode which activates automatically if the file itself is read-only or when I open a library source code. However I don't know how to force the reader mode for an arbitrary file.
I am not asking how to change the file attribute to read-only.
I want to keep the file editable in the file system, and just have it read-only in IntelliJ IDEA.
I got an official answer from JetBrains:
Unfortunately, it seems there is no possibility for now to enter Reader Mode without making a file itself read-only.
EDIT:
On 04 Mar 2024 JetBrains created a change request Have a readonly mode without changing file attributes. Let's see how it is progressing :)