I was hoping that I could have Sublime set a different color scheme for different projects. So if my default is Monokai, use Monokai; but if a project has for example the Visual Studio Dark theme as preference, then changing to that projects would update the color scheme to that. And then changing back to another project would update color scheme to Monokai again.
The .sublime-project
contains a JSON element, so I was hoping maybe I can copy my color scheme setting in there, so I turned that file into:
{
"color_scheme": "Packages/Visual Studio Dark/Visual Studio Dark.tmTheme"
}
And I've also tried:
{
"preferences": {
"color_scheme": "Packages/Visual Studio Dark/Visual Studio Dark.tmTheme"
}
}
But it didn't work. Changing projects back-and-forth didn't update the theme.
Does that functionality exist?
This is possible, but it doesn't go into the top level element of your sublime-project
file. Project specific settings, as outlined in the official documentatuion, go inside of a key named settings
:
{
"settings":
{
"color_scheme": "Packages/Visual Studio Dark/Visual Studio Dark.tmTheme"
},
}
Not all settings are allowed in project specific settings. In particular, only Editor settings are allowed, and the User Interface and Application Behaviour settings are not allowed. If you look in the default preferences, the top settings are the editor settings, and then there's a comment that indicates when the other settings groups begin.
Basically what this means is that things that control the behaviour of the application as a whole (like what shape the tabs are or whether or not git support is enabled) aren't customizable per project, but things that can be altered on a file by file basis are.
More details on preferences in Sublime in general (including examples of using a custom color scheme per project or per file type) can be found in this video on Configuring Sublime Text.