Sublime Forum

Dim .spec files in sidebar

#1

Is there an easy way to do it, or is there anyone knowing about such plugin?

For example if I have the following files in my sidebar:

  • intex.js
  • index.spec.js
  • main.js
  • main.spec.js

I want to dim the .spec files, essentially applying a filter on the listed files. The reason why is because .spec files can become quite annoying when you actually search for the source files on a project with forced test files along with the source.

Thanks!

0 Likes

#2

Currently the only facility that exists for altering the color used to render side bar elements on an file by file basis is via their git status. In that case, anything that’s a file that is explicitly being ignored by git will appear dimmed automatically.

Apart from this there’s not an exposed API for altering the side bar rendering.

Have you tried adding "*.spec.js" to the binary_file_patterns setting in your user preferences? That would allow those files to appear in the side bar, but Sublime won’t search inside of them unless you have one open and tell it to search open files. It would also stop them from appearing in the Goto Anything file list, however.

0 Likes

#3

I see. Thanks for the feedback. Adding the .spec.js files to binary_file_patterns won’t help in case I want altered rendering in the sidebar, because I’m using the sidebar, not only ‘go to anything’.

0 Likes