software

Excluding folders from indexing in Sublime

Sometimes we work in projects with tons of Javascript dependencies. Folders like node_modules and bower_components are a pain in the neck because every time that we need to find something in the project the content of these folders will be used in the search.

Sublime offers 2 settings to hide these files from the index. First of all, open the User Preferences (Preferences -> Settings – User):

  • binary_file_patterns: This option excludes files from the index but keep them in the sidebar.
  • folder_exclude_patterns: This option excludes files from the index and sidebar. This is why, for example, you don't see the .git folder in a project.

My final setting is:

"binary_file_patterns":
	[
		"*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip",
		"node_modules/**",
		"bower_components/**",
		"tmp/**"
	]

I also decided to add it the tmp folder, which is used by all kind of frameworks.

Interactions

Webmentions

Like this content? Buy me a coffeeor share around:

0 Like

0 Reply & Share