Read-only files
If a file is read-only, it is marked with the closed lock icon in the status bar. If a file is writable, it is marked with the open lock icon
.
Open a file in the editor and click the lock icon
/
in the status bar.
Alternatively, select a file in the Project tool window (Alt01), go to File | File Properties in the main menu and click Make file read-only.
Files can be read-only in certain cases. In these cases, clicking the /
icon the status bar will not make the file writable.
The file is a decompiled class. Complied classes are normally read-only in IntelliJ IDEA.
The read-only status is set by a version control system. For example, the file can be locked by Subversion.
In this case, use IntelliJ IDEA version control integration features to make the file writable.
The file size exceeds 2.5 MB. Such files are considered too large for editing.
Library files in IntelliJ IDEA are normally read-only by default as the code from them should be used as is. For such files, you will not see the lock icon in the status bar. IntelliJ IDEA applies Reader mode to library files by default.
The file does not belong to the project. In this case, the Non-Project Files Protection dialog appears, prompting you to select an action.
The file belongs to the generated sources
or generated test sources
root. Files in these folders are usually read-only as they are generated automatically rather than written manually and can be regenerated. Learn more about different types of folders from Content roots.
The file may be marked as read-only in your operating system. To check this status, you can inspect file attributes on Windows or permissions on Unix-based systems like Linux or macOS.
Thanks for your feedback!