Sublime Forum

Project Configuration - Duplicate Folders & Folder Includes

#1

Unfortunately, it seems like the documentation on project configuration is pretty light.

sublimetext.com/docs/3/projects.html
I’ve been playing with the project settings a bit and have encountered the following problems when configuring them:

  1. It doesn’t appear that you can add the same folder twice with different file and folder include/exclude filters.
  2. I’m having difficult recursively including a folder, while excluding others.

Here’s the project configuration I’m working with:

// Project files are stored in ~/.sublime/projects on all platforms.
// All paths are relative to ~/.sublime/projects.

{
    "folders":
    
        {
            "name": "bash",
            "path": "../../",
            "file_include_patterns": 
                ".bashrc.d/*",
                ".bash_profile",
                ".bashrc",
                ".profile",
                ],
            "folder_include_patterns": 
                ".bashrc.d/*"
            ]
        },
        {
            "name" : "zsh",
            "path" : "../../",
            "file_include_patterns": 
                ".zshenv",
                ".zprofile",
                ".zshrc",
                ".zlogin",
                ".zlogout"
            ],
            "folder_include_patterns": 
                ".zsh"
            ]
        }
    ]
}

With this snippet only the first instance of my home folder (relative path …/…/) is included. The second is not.
The .bashrc.d folder contains nested directories. I want all files and folders in this directory to show up in the project.

Any ideas?

2 Likes

#2

As a workaround I think you can add useless “/”, such “…//…/”

0 Likes

#3

This question was previously asked here. I’m seeing the same problem on 3126, and the workaround suggested by @tito does not work.

0 Likes

#4

My work around was to create a sys-link to the desired path, and provide the path to that sys-link along with the "follow_symlinks": true option for that folder in the project settings.

This is less than ideal, as it doesn’t transfer across SCM unless you have some script to re-link the correct folders in the new cloned location. Also, this is unreasonable as a long term solution even in permanent locations, because while in Sublime Text there are the customized views such as the above example from the original post, but on the file system there now appear all these seemingly duplicate folders.

0 Likes