Sublime Forum

Solved: Listing project folder twice in same project

#1

Editing a project definition file, is there a method to display the contents of a folder twice or more but with distinct include/exclude patterns?

This is a project file I wish to set-up:

{
"folders":
[
	{
		"path": "/home/xxxx/utility",
		"file_include_patterns": ["*.sh"],
		"file_exclude_patterns": ["batch*.sh"],
		"folder_exclude_patterns": ["*"]
	},
	{
		"path": "/home/xxxx/utility",
		"name": "txt",
		"file_include_patterns": ["*.txt"],
		"folder_exclude_patterns": ["*"]
	}
]

}

Saved, the side panel only displays the first definition, the second is omitted.

0 Likes

#2

It seems that maybe sublime is using that path as a way to deduplicate entries before generating sidebar content.

One way around this might be to create a symlink of the path

ln -s /home/xxxx/utility /home/xxxx/utilitytxt

then your config can be

{
"folders":
[
	{
		"path": "/home/xxxx/utility",
		"file_include_patterns": ["*.sh"],
		"file_exclude_patterns": ["batch*.sh"],
		"folder_exclude_patterns": ["*"]
	},
	{
		"path": "/home/xxxx/utilitytxt",
		"name": "txt",
		"file_include_patterns": ["*.txt"],
		"folder_exclude_patterns": ["*"]
	}
]
}
0 Likes

#3

Thanks for the suggestion. It works!:grinning:

If adopting this, be sure to modify your back-up software not to follow symbolic links, only copy the symbolic link definition.

1 Like