Published 04-19-2024
TOML stands for “Tom’s Obvious, Minimal Language”. It’s a configuration file format that’s easy to read and has noticeable advantages over alternatives like json for configuration files. Here is the basic syntax.
# Primitive Values
enable = true
initial_value = "string"
value = 0
# Tables (Hash tables or dictionaries)
[check_ticket]
infer_ticket = true
title_position = "start"
# Arrays of Tables
[commit_scope]
[[commit_scope.options]]
value = "app"
label = "Application"
[[commit_scope.options]]
value = "share"
label = "Shared"
[[commit_scope.options]]
value = "tool"
label = "Tools"
For an in-depth breakdown of the syntax, see the documentation.
Starship
, a highly-flexible terminal prompt.I have a side-project that uses json for it’s configuration file. - Here’s a comparison of the exact same configuration in json and toml.
"value": "app"
, the line is indented 4 tabs in json. The equivalent, only uses 1 tab in toml. Additonally, toml lets you configure indentation to your likingFurther reading and examples below. - If you enjoyed this article, consider checking out Flotes. It’s the Markdown note taking and study application we use to learn and research topics like the one in this article.