ulyssa / iamb

A Matrix client for Vim addicts
https://iamb.chat
Apache License 2.0
608 stars 45 forks source link

Support loading a TOML configuration #229

Closed ulyssa closed 6 months ago

ulyssa commented 6 months ago

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 that default_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 for config.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 the config.json support indefinitely. (serde should keep that straightforward and not a maintenance burden since JSON and TOML have similar types and structures.)