IntelliJ IDEA Tip: Change Background Color for Read-Only Files
When I’m editing a file, I like to know immediately whether I’ve checked it out for editing, or if it’s in read-only mode. Sure, you can look at the at the editor tab and see if there’s a little tiny lock icon
on the editor tab (when you’re running at 1920x1200 on a laptop screen, tiny is really tiny), or maybe the color of the tab text is black. However, I prefer a much more obvious way: making the background of the editor a color other than the standard white. Note: if you have colors set up such that the background isn’t white, you can still use this tip, just use a different color than in my example.
So, an editable file looks like this (white background):

And a read-only file looks like this (a slightly blue-tinted background):

I find that the slight color change is obvious enough to let me know I’m looking at a read-only file at first glance, yet subtle enough not to get in the way of reading the code.
Changing It
I recommend opening up a read-only file before adjusting the settings so that you can see how it looks while you’re adjusting the colors (see step 6 below).
1. Open up the IDE Settings (Ctrl+Alt+S for me) and select “Colors and Fonts”:

2. If the General tab isn’t selected, click on it. Underneath you’ll see a list of items: select “Background in readonly files” (pointed to by the green arrow). Don’t confuse this entry with the “Readonly fragment background” (pointed to by the red arrow).

3. If the Background checkbox
isn’t selected, then select it.

4. Right-click on one of the gray boxes on the right-side to customize the color. You’ll see this dialog show up:

5. Adjust the color to something subtle: keep in mind that you want a very light (i.e., low saturation) color. The little swatch that you see in the color selector is misleading: you’ll think the color is light enough, but it’ll end up being darker than you expect when it’s the background color for the whole editor. I suggest using the RGB values above (R=247, G=255, B=255), but feel free to experiment. After you’ve “mixed” your color, click the OK button and you’ll now see your color as one of the “customized colors” on the right side of the pre-selected color palette:

6. After you click on your new color, you can hit the Apply button and, if the current file showing in the editor is read-only, you’ll immediately see the background color change. Click the OK button once you’re done and you’re all set!


Nice tip, I hadn’t thought about it before but it proves useful
Comment by Thibaut — March 4, 2008 @ 8:15 am