Sublime Forum

Not able to override themes in syntax specific files

#1

Hi!

I’m able to set a UI themes and color schemes in my user settings and for syntax specific files, I can change my color scheme, but I’m not able to change the UI theme. Ideally, what I’m trying to do is have ST3 look completely different - UI and color-wise - depending on which type of file I’m working on.

That’s what I have for my Python syntax

// These settings override both User and Default settings for the Python syntax { "color_scheme": "Packages/ayu/ayu-mirage.tmTheme", "theme": "Material-Theme.sublime-theme", }

But as you can see, it’s still using a different theme (Ayu Mirage, specifically which is the default one) <img src="/uploads/default/original/3X/8/d/8d804cba8129c4071e9726a790525284daa5c2d9.png" width=“690” height=“420”

Am I doing something wrong? Or is overriding UI themes not possible

0 Likes

#2

I don’t think that it’s possible to swap Themes this way since they’re a global thing that affects the entire application.

1 Like

#3

Bummer, that’s what I was fearing. Oh well. thanks, anyway

0 Likes

#4

You could do this with a plugin. It is not impossible, but it isn’t trivial like it is with syntax. If it is something you are really determined about, you may need to learn a little about writing plugins. I’ve done theme switching based on time of day via a plugin, there is no reason you couldn’t write a syntax specific theme switcher, but that may be more work than you are looking for.

0 Likes

#5

Specifically, sublime text occasionally doesn’t load or unload themes properly on the fly, so you might end up with placeholders instead of the actual images and have to restart. It just wasn’t designed to be able to switch themes dynamically.

1 Like