Last Updated: October 16, 2018
·
67.83K
· nccong

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,
}

6 Responses
Add your response

binaryfilepatterns does not work for folders...

over 1 year ago ·

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 ·

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

over 1 year ago ·

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 ·

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

over 1 year ago ·

@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 ·