I don’t know if this will work, because I was mainly interested in colour scheme changes (in my old job) rather than theme changes as such. But I did this using a plugin rather than sublime project settings, so this may work for you. It’s possibly quite inefficient, because the plugin inspects the file’s path when it is “activated” in the editor, and I just hard-code my own colour scheme for specific components in the path. The bit that’s of interest is that I also set the theme for some reason (presumably because this mechanism didn’t work without that). Now, I use the same theme for each case here, but it may be work trying this approach to see if you can change the theme this way.
I don’t actually make use of this at the moment, so it might have suffered from bit-rot, but here is the plugin code for you to try if you like:
import sublime, sublime_plugin
class ThemeSwitcher(sublime_plugin.EventListener):
def on_load(self, view):
if view.file_name():
print(view.file_name())
def on_activated(self, view):
fileName = view.file_name()
if fileName:
if "-main" in fileName or "-hmain" in fileName:
view.settings().set('color_scheme', 'Packages/User/Blurk-main.tmTheme')
view.settings().set('theme', 'Blurk.sublime-theme')
elif "-tmp" in fileName or "-alt" in fileName:
view.settings().set('color_scheme', 'Packages/User/Blurk-tmp.tmTheme')
view.settings().set('theme', 'Blurk.sublime-theme')
elif "-current-rel" in fileName or "-hrel" in fileName:
view.settings().set('color_scheme', 'Packages/User/Blurk-current-rel.tmTheme')
view.settings().set('theme', 'Blurk.sublime-theme')
else:
view.settings().set('color_scheme', 'Packages/User/Blurk-default.tmTheme')
view.settings().set('theme', 'Blurk.sublime-theme')