Sublime - 从搜索结果中删除 .cache 文件

Sublime - Remove .cache files from search results

我在 sublime 中经常使用 command-shift-f 函数来 grep 我的存储库。但是,总是会出现长的、缩小的 .cache 文件,我不想更改这些文件,因为它们是自动生成的。

有没有办法阻止 sublime 搜索或隐藏那些 .cache 文件的搜索结果?

如果您查看首选项菜单 -> 设置,您会在左侧的默认 Preferences.sublime-preferences 文件中找到:

// 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"],

您只需将其复制到右侧的用户首选项中,然后添加 , "*.cache"before the]and.cache` 文件将不再被搜索,因为它们将被将它们视为不值得搜索的二进制文件。