-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Request] Conditional toml
tables & variable substitution
#7575
Comments
you have imports in |
@kchibisov
|
Great, thanks. After the initial migration I was faced with some spurious error complaining about the very same import, which threw me off a bit. |
Hi, and sorry in advance if there is an issue for this already (didn't find any).
TLDR
Substitution & Conditional tables:
Not So TDLR
Going from
yaml
totoml
was painless, though the former allowedimporting
otheryaml
files. In my case my dotfiles are setup so that it works seamlessly over linux/macos/windows (a script just symlinks the corresponding content of the os specific configs to~
).In the case of
alacritty
for my dotfiles macos and windows symlinks the samealacritty.yaml
, and then they have their ownalacritty.local.yaml
. The first line in the sharedalacritty.yaml
just has a line that imports it (basically justimport = ["~/.config/alacritty/alacritty.local.yaml"]
). Obviously repetition is gladly avoided especially for something like this, because issues are noticed at a much later moment.Given that
toml
doens't support importing othertomls
, it would be very convenient to have anenabled
field, withalacritty
supplying a small set of substitutions for perhaps the most obvious cases (OS,alacritty
major/minor...) and very basic operators. In my case I just need OS, but I think it's not a bad thing to at least having something like this in place for the future. Obviously it should be kept trivial.The example itself isn't the most interesting one since, of course, I "could" just have it in
PATH
. But I still think the feature is worth considering.The syntax can be whatever works best (while still being valid
toml
format), andenabled
can also be called whatever else that is more suitable.All the best!
System
OS: Linux, macOS & Windows
Version:
alacritty 0.13.0 (78fa4d6)
Linux/BSD: Wayland, Sway
The text was updated successfully, but these errors were encountered: