VS Code allows custom settings (e.g. themes) by User, by Workspace (e.g. window), by Workspace Folder (e.g. multiple repos in one workspace), but not per sub-folder in a single repo.
This extension solves that problem.
- Create a
.vscode
in the folder you want to customize, say/backend
. - Create a
settings.json
in there. - Put your settings in there. e.g. for changing theme when any of the files in that folder (and subfolders) are open, you can add the following in
<projectRoot>/backend/.vscode/settings.json
{
"workbench.colorTheme": "Red"
}
- Now create another one in a different folder, e.g.
<projectRoot>/frontend/.vscode/settings.json
being:
{
"workbench.colorTheme": "Monokai Dimmed"
}
That's it! Switch between the files in the above folders and enjoy. ;)
Everytime an editor is opened, this extension looks for .vscode/settings.json
in the immediate parent folder of that file, and recursively goes up until it finds on (or give up).
In case it finds one, it applies the settings to the WorkplaceFolder Configuration. That's limited to the workspace that's open, and not globally for all VS Code workspaces and windows.
Otherwise, if it doesn't find any .vscode/settings.json
all the way to the root, it resets all the attributes it has ever changed, to its default value.
Unless you want your configs to be shared with other people, you can add **/.vscode/**
to your .gitignore
. B-)
Special thanks to @jsaulou for making Theme-By-Language extension which led into this extension!
Cheers!