znswpq
Last Updated: March 28, 2016
·
13.67K
· javiercr
Wh3vnhu1e1g0hdfuxhnc

Hide cache folders (or any folder) in Sublime Text 2

When working on a Rails project with Sublime Text 2 if you're using for instance SCSS files, those files will be compiled to my_app/tmp/cache and they will show up when doing a search or when using the "go to file" shortcut (⌘ + T), pretty annoying.

To avoid seeing these files (or any other folder in the project) go to User Settings (⌘+ ,) and add this line:

"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "tmp/cache"]

Thereby anything inside my_app/tmp/cache will be invisible.


If you prefer you can use patterns to match file names instead of directories:

"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db"]

Finally you can use both tricks in a project basis if you save the project (Project » Save project As) and then edit its settings (Project » Edit project):

{
  "folders":
  [
    {
      "folder_exclude_patterns": ["tmp/cache"]
    }
  ]
}

Happy coding!

Say Thanks
Respond

5 Responses
Add your response

3275
97205e729bfa694358461342b97b7f14

Awesome. Just got into Sublime Text 2.
Every little tid bit like this helps.

over 1 year ago ·
3306
Avatar

This is gold! The .sass-cache folder from the Compass Framework really bugged me, now those pesky files no longer show up :)

over 1 year ago ·
3308
Wh3vnhu1e1g0hdfuxhnc

Glad it helps :)

over 1 year ago ·
13277

Great tip. I'll use this a lot at work!

over 1 year ago ·
25188
None

Consider using "binary_file_patterns" instead if you don't want to hide the files from the sidebar. Use a trailing / to denote folders e.g. ".git/"

over 1 year ago ·