JetBrains editors are really great for all kind of projects, whatever big they are. However, once you’ve started working on big projects, you’re beginning to notice that it’s getting harder finding your way through open files, the project tree, the search results and so on.
Therefore JetBrains introduced a nifty feature called File Colors. It allows developers to add custom colors to specific groups of files according to a pattern. For example, it could be:
- Excluded Files
- Erroneous files
- Build Files
You can even set specific folders representing different parts/modules of your project.
These colors will be then displayed in different parts of the IDE, namely:
- Project Tree
- Editor Tabs
- Find in Path Dialog
- Search Everywhere dialog
- Navigate to file/class/symbol dialog
- And other places…
This will considerably reduce the time looking for a file and navigating thanks to color grepping.
The JetBrains editors come prebundled with at least two File Colors:
- Excluded files, e.g. files that are Marked as Excluded, and therefore excluded for indexing, searching and navigation, resulting in huge performance boosts. Such examples are
gradleetc… You can mark a directory for exclusion by clicking right on the directory and select
Mark Directory as...
- Tests, which is the test directory in gradle/rails/symfony…
Specific IDEs might have other File Colors preinstalled.
You can see them in
Settings -> Appearance & Behavior -> File Colors.
There you can add new Local colors, share them across projects, disable them on the project view/tabs/both, and last but not least you can reorder them to give precedence to one in case two or more file colors are falling in the same pattern rules.
However these two options are pretty limited, but you can add your own file colors according to certain patterns. For example, differentiating between the
docs directory than the rest of the source.
To do so, one must create a Scope. There you can define your pattern rules, which directories are included in the scope, which are excluded, and so on. Finally add your new created scope in the File Colors list, and rise it up to the top so it won’t be shrouded by previous file colors.
See more at File Colors
Material File Colors
Update (02/22/18): Since version 1.8.2, the plugin is currently overriding the default Non-Project Files Color with the current theme’s disabled color when the application starts, so there is no need to install the File Colors manually. Of course if you already changed the color it will not be applied.
File Colors are pretty neat, but the actual prebundled File Colors are adapted for the Darcula/IntelliJ look and feels, not for the Material Themes.
To remedy this, the Material Theme is also coming prebundled with File Colors, specifically for Excluded files.
However, because the File Colors are user settings, and because the user could very possibly have modified the default Excluded Files’ file colors, the plugin could not override this setting with a better suited color. Therefore, the plugin is bundled with additional excluded files colors, one for each theme.
These are not installed automatically, as people not necessarily want this setting. Therefore, to install them just select the
Install Material File Colors action from the Panel Options section of the Material Theme Configuration popup. New file colors for Non-project files scope will then be added to the list. Just select your preferred color on the top of the others to apply it to the project.
Q: I’ve switched to Darker Theme and now my Project Tree is very hard to read!
A: As I said, simply put the
Darker Excluded Files Color at the top using the arrows, then save.
Q: What happens if I remove/modify the bundled colors?
A: If you want to add them back, just run the action again. Not however that existing colors will not be overriden, thus if you find yourself with too many colors just remove the ones you don’t need.
Q: Is there a way to change the text color?
A: The color of the text is controlled by another setting. See File Status Colors for more info.