Monday, June 16, 2014

Color Code Directories in IntelliJ or RubyMine

For many projects, I'll create a "lex" directory with temporary files and notes and such.

Some of those files are some times source code.

When I search, some times I want to see that code, but every time I want to know whether the file I'm looking at in the IDE is from the "lex" directory. (That way, I can prevent myself from accidentally working on temporary files.)

Here's my solution... to use Color Coded Directories in the IDE.

Create a Custom Scope

  • Preferences > Scopes (in IDE main menu)
  • Click "+" (in the upper right hand side)
  • Name your scope (in my example I'll name it "lex" and make it a local scope)
  • Click the twistie icon in the directories control and select directory(s) to color code.
  • In this example, I' chose the "lex" directory, that is at the root to the project
  • Click

Color Code Custom Scope

  • Preferences > File Colors
  • Click "+" at the bottom left of the Shared Colors pane.
  • Choose "lex" in the Scope dropdown
  • Choose a color, like "Orange"

Now, all files and directories in the Project Explorer under the "lex" directory will have an Orange background color.

Also, when you open files from the "lex" directory, you'll know it because their file tabs will be Orange.

Not only that, but when you click Command+B to get a dropdown list of references, those selections will also be color coded if they are coming from a file under the "lex" directory.

This is my favorite IntelliJ/Rubymine Feature :-)


No comments:

Post a Comment