Exclude node_modules from sublime search

Have you had a prob­lem where you use Find And Replace at the root of your project inside the sublime text, and there are bunch of search results from node_modules, bower, which you don’t care?

Solu­tion 1

If you want to exclude a direc­tory from your search results, add this the fol­low­ing fil­ter in your query:


For exam­ple, when you type the fol­low­ing query as shown in the image

/PWD/<pr_root>, -*/bower/*, -*/node_modules/*


It will search for helpers word inside the root of your project exclud­ing the node_modules and bower direc­tory. Note the sec­ond query uses a rel­a­tive path.

Solu­tion 2

To glob­ally exclude fold­ers from search results, put these set­tings in


// Packages/User/Preferences.sublime-settings "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules", "bower", "coverage", "test-results"]

You may also like...