Skip to content

Instantly share code, notes, and snippets.

@dannycroft
Last active February 27, 2019 18:25
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dannycroft/6609447 to your computer and use it in GitHub Desktop.
Save dannycroft/6609447 to your computer and use it in GitHub Desktop.
Exclude node_modules out of Sublime Text 2 searches
// Add the following to your preferences file
"folder_exclude_patterns":[".git","node_modules"]
@ph3nx
Copy link

ph3nx commented Nov 10, 2014

Thank you!

@CacheControl
Copy link

👍

@adam-beck
Copy link

But this also removes it from the sidebar, correct? Any way to just remove it from the searching?

@philosoralphter
Copy link

@adjohu
Copy link

adjohu commented Aug 5, 2015

+1

@lomteslie
Copy link

@adam-beck Try the following: "binary_file_patterns": ["node_modules/*"]

@efosao
Copy link

efosao commented Nov 14, 2015

@nfantone
Copy link

nfantone commented Jan 3, 2016

To all '+1'-ing @adam-beck, this is the solution you are looking for:

"binary_file_patterns": [".svn/", ".git/", ".hg/", "CVS/", "node_modules/", "bower_components/"]

Note the '/' at the end of the paths.

This effectively excludes those folders from searches, but keeps them in the sidebar. Works on ST3.

Credit goes to: https://twitter.com/klaemo/status/294170840063422464

@evenfrost
Copy link

This excludes folders from indexing (Ctrl+P), not from searching (Find in Files, Ctrl+Shift+F). As for now there seems to be no way to exclude a folder both from indexing and searching but preserve it in sidebar.

@ringcrl
Copy link

ringcrl commented Oct 23, 2016

@nfantone Work for me,Thx~!

@brandonsueur
Copy link

👍 💯

@dayuoba
Copy link

dayuoba commented Apr 13, 2017

nice,thx a lot

@duhovny
Copy link

duhovny commented Nov 17, 2017

Alternatively, you can use:
Find > Find in files... (CMD+SHFT+F)
Where: -*/node_modules/*

@sunlee-newyork
Copy link

@nfantone 👍 thank you!

@codeluggage
Copy link

With node_modules/* this also excludes from cmd+p in Version 3.1.1, Build 3176. Thank you! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment