-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The ability to define global theme overrides #5839
Conversation
Instead of a seperate config file could this not be subkeys in [theme.overwrite]
# Theme overwrites here |
Exactly my thoughts as well, but |
@pascalkuthe wouldn't it add unnecessary overhead to the configuration file if a user wants to make too many overrides? That was my thinking. |
Ad damm I always forget about that. I hate that aspect of toml even if that makes it a lot easier to deal with. You could do soo many cool things like this. [theme]
name = "onedark"
[theme.overwrite]
# Theme overwrites here Might be confusing tough so perhaps just adding a separate [theme_overwrite]
# Theme overwrites here Not sure which of those two options are better.
I think a global overwrite like this is only useful for a few themekeys like the background and maybe the cursor. I would be very cautious about adding new config files. |
That is correct and my use case as well.
I think including this in the config is the better choice anyway but for my reference, what is the potential issue with adding new config files? Regarding how to define in the config, first option seems more extendable and structured. However, wouldn't it break existing configs? |
Primarily, If we keep adding new config files, the config becomes more spread-out and harder to find what you are looking for.
As I said we would allow both options for backwards compatibility. It's a bit confusing that you would need to change the way the theme name is specified if you want to overwrite something that's why I also offered the second alternative but we do stuff like this already for other settings too so it's probably fine. |
This is quite common, and serde even has a doc page on the subject: https://serde.rs/string-or-struct.html. |
@pascalkuthe these changes capture what I meant to do |
Currently, making changes to a theme is only possible by inheritance or editing the theme directly. Both of these options require a per-theme approach. But overrides such as "using the terminal's background" usually are meant for any theme. This makes it annoying to change themes after doing some alterations to the previous one.
This PR add the option to create atheme_overrides.toml
file in the config directory and apply the changes to any theme currently active.This PR adds the option to use a
theme
table inconfig.toml
that hastheme.overrides
option. The keys specified here will override the active theme.:theme
.theme.overrides
table is internally the same as a theme so any subkeys a theme can have, overrides can also have.Example:
A somewhat related issue