Support loading a TOML configuration #229
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Between testing out different configurations and updating the docs for the upcoming v0.0.9 release, I've been feeling like iamb's kind of pushing the comfort zone for using JSON as a configuration language. Specifically, the inability to comment out lines while trying things out, and the way per-profile configurations can end up deeply nested. TOML's sections seem well-suited for avoiding deep nesting, and its syntax is small and easy to learn. The only pain points I can think of is trying to express multiple window splits in the
layout.tabs
value, and the fact thatdefault_profile
lies outside any section, and therefore must always be placed first in the file.I've written this so that it first checks for and loads a
config.toml
file, and then checks forconfig.json
. I'm going to update the manual pages and site to talk about the TOML config, since the examples should be easier to understand and read that way, but I plan to keep theconfig.json
support indefinitely. (serde
should keep that straightforward and not a maintenance burden since JSON and TOML have similar types and structures.)