When you are working on a project in Sublime 3 it is sometimes useful to exclude files and folders in Sublime 3 search. You typically do not want to search in minimized files, .map files and you often tend to want to exclude the node_modules directory. This can be done in Sublime 3. Just pick “Add Exclude Filter:
and add the following:
, -*.map, -*.min.js, -*.min.css, -*/node_modules/
behind the folder you picked to search in and go for the item to search for. So the where bar could look like something like:
/Users/jasper/webdesign/vue-basics/todo-app,-*.map, -*.min.js, -*.min.css, -*/node_modules/*
Excluding Files
So as you can see you can exclude a file using -*.file-extension
. Do not forget the minus! This will exclude all files that end in that extension. It really is as simple as that. You can of course add this to your preferences as well if you always want to exclude certain file types, but I tend to change this a lot from project to project. So I keep some copy and paste code around to quickly exclude stuff. Quick example here:
-*.min.css
Excluding Directories
If you want to exclude directories that pretty much goes the same as excluding files. You start with -*
and then the directory in between /
. For example:
-*/node_modules/*
do you know how can i save these exlude settings?
Every time i restart my sublime project, they are gone.