Sublime Forum

How to exclude directory from GUI and keep it indexed?

#1

Hi! I have a problem with Sublime project configuration.

I am creating the PHP web project using Symfony framework and Composer dependency manager. In the main project directory, there is a “vendor” subdirectory. I want to hide it from GUI (sidebar, goto anything, find in files etc.) but I want to keep it indexed in Sublime Text’s index because PHP Companion plugin uses this index for its features.

I tried to use following .sublime-project file without success. With this file, Sublime is not indexing “vendor” directory at all.

{
	"folders":
	[
		{
			"path": ".",

			"folder_exclude_patterns": [
				"bin",
				"vendor",
				"var",
			],
			"file_exclude_patterns": [
				".gitignore",
				"composer.lock",
				"symfony.lock",
				"*.sublime-project",
				".web-server-pid",
			],
			"index_include_patterns": [
				"*.php",
				"vendor/*.php",
			],
		}
	],
	"settings":
	{
		"tab_size": 5,
	}
}

It seems to me that when the directory is excluded inside folder_exclude_patterns it cannot be re-included inside index_include_patterns. I am sure this syntax of index_include_patterns works properly because “vendor” directory is properly indexed when I comment “vendor” line inside folder_exclude_patterns.

It there any way to only index files without showing it in GUI? If not, it would be nice to see this feature in next Sublime releases, especially for use cases like mine.

0 Likes