Search code examples
sublimetext2sublimetext3sublimetext

Sublime - Remove .cache files from search results


I use the command-shift-f function a lot in sublime to grep my repository. However, there's always long, minified .cache files that show up which I wouldn't ever want to change since they're automatically generated.

Is there a way to stop sublime from searching or hide search results of those .cache files?


Solution

  • If you look in the Preferences menu -> Settings, you will find this in the Default Preferences.sublime-preferences file on the left:

    // These files will still show up in the side bar, but won't be included in
    // Goto Anything or Find in Files
    "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
    

    you can simply copy this to your user preferences on the right, and add , "*.cache"before the]and.cache` files will no longer be searched because they will be treated as if they are binary files not worth searching.