Exclude a directory from searching in Sublime Text 2/3
If you want to exclude a directory from your search results, when searching in ST2, add this this filter:
-*/name_of_dir/*
So for example, in a Rails project, if I want to search for something in the app/ folder, but exclude the assets folder, I would write in the where
field:
/Users/Username/Repositories/myapp/app,-*/assets/*
However, this is a bit tedious to do every time. This technique is suitable for excluding folders on per case bases. To globally exclude folders from search results and goto anything, put these settings in Packages/User/Preferences.sublime-settings
:
- ST2:
"binary_file_patterns": ["name_of_folder/"]
- ST3:
"folder_exclude_patterns": ["name_of_folder"]
Written by Alex Popov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sublime-text
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#