Scopes in JetBrains IDEs

Written on 2020-09-26

Any JetBrains IDE has an amazing feature that can significantly improve your development experience; whether it's PhpStorm, WebStorm, IntelliJ IDEA, PyCharm, or any other project; this feature enables better search and allows for custom file colours.

For example, this is what I'm talking about:

A tree view configured with coloured scopesA tree view configured with coloured scopes

These colours allow you to easily recognise files, and that in turn allow you to think more freely about things that really matter when coding. First you'll want to configure one or more scopes. A scope is a set of textual filters that are applied on your files, you can configure them by going to Settings > Scopes.

You can use the buttons to include and exclude folders and files, or you can write the filters yourself. There's a special syntax to do that, you can read about it described here. Don't forget you can expand the text area for easier configuration:

File colours

Every scope can be applied a specific colour. This makes it easy to easily spot files.

By applying colours to a scope, you'll see them in the tree view, in file tabs and when using file navigation.

Check out my latest video: DX matters

Filtering by scope

Besides colours, scopes also allow for easy filtering. For example, in the tree view:

File coloursFile colours

But also in the finder:

File coloursFile colours

Defaults

Setting up scopes shouldn't take longer than 10 minutes every project, and saves a lot of time in the long run. There's also the possibility to set default options though, which will be used every every time you create a new project. Go to File > New Project Settings > Preference for New Projects and configure your default scopes and colours over there, the same way you'd do as explained before.

And just in case you'd need some inspiration, these are my default scopes:

App
file:app//*||file:config//*||file:routes//*||file:app||file:config||file:routes||file:src//*||file:src

Resources
file:resources//*||file:resources

Database
file:database//*||file:database

Things I wish I knew when I started programming

Things I wish I knew when I started programming cover image

This is my newest book aimed at programmers of any skill level. This book isn't about patterns, principles, or best practices; there's actually barely any code in it. It's about the many things I've learned along the way being a professional programmer, and about the many, many mistakes I made along that way as well. It's what I wish someone would have told me years ago, and I hope it might inspire you.

Read more

Comments

Loading…
No comments yet, be the first!
Noticed a tpyo? You can submit a PR to fix it.
HomeRSSNewsletterDiscord© 2025 stitcher.io