dza-mw
Last Updated: May 18, 2017
·
39.45K
· nccong
0 umn4tok5crzeuybagoqwtg5omzlq2y9amy8btynzl95n143lhxkqpphr8gam7ucjssn6gronitxv

Exclude files/folders in Sublime Text

While developing NodeJS app, there are too many unnecessary files appear in Go To Anything search. These sublime-settings has made my life easier:

Copy those keys from Settings - Default and paste them to your Settings - User

"folder_exclude_patterns"

This excludes the whole folder from sidebar tree and search. Yeah you will see "node_modules" here.

"file_exclude_patterns"

This excludes the files from sidebar tree and search

"binary_file_patterns"

This excludes the files from search but still shown in sidebar tree

But what if I want to exclude a folder from search but let it be shown in sidebar?

No worries, put "no_search/*" in

"binary_file_patterns": ["no_search/*"]

Alright, here is the full settings from Settings - Default, added some peace of mind. Save, restart ST and enjoy.

{
  "folder_exclude_patterns": ["node_modules", ".svn", ".git", ".hg", "CVS"],
  "file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db", "*.sublime-workspace"],
  "binary_file_patterns": ["generated/*", "*.tbz2", "*.gzip", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
}
Say Thanks
Respond

6 Responses
Add your response

17381
None

binaryfilepatterns does not work for folders...

over 1 year ago ·
18237
E948ba96fa5b746ebe80390f911732e7

I added folders to my binary file patterns array and it worked for me. "folder/*". No idea if this removes the files from the indexing process, but I would assume so.

over 1 year ago ·
18240
078c8867db2a3c40cdf5c4fd2b94201c

I couldn't get the binary_file_patterns to exclude folders either - using ST3.

over 1 year ago ·
19330
None

How do you use the no_search feature? Let's say I wanted to show the build folder in the tree but excluded it from search. How would you go about setting that up?

"folderexcludepatterns": [
"build",
"nodemodules",
"bower
components"
]

over 1 year ago ·
27574
Decadenza

This should be added to Sublime Text 3 documentation. Thank you!

over 1 year ago ·
28178
0 umn4tok5crzeuybagoqwtg5omzlq2y9amy8btynzl95n143lhxkqpphr8gam7ucjssn6gronitxv

@xeroxoid hence I used "no_search/*"

@boefly: the settings you would need is "binaryfilepatterns": ["build/*"]. This should ignore all files under build/ folder.

over 1 year ago ·