Configuration
Settings live in ledgerfmt.toml, discovered upward from the file being formatted.
Example
[format]
amount_column = 52
indent = 4
currency_position = "suffix"
align_comments = true
[files]
extensions = ["journal", "ledger"]
[format]
| Key | Type | Default | Description |
|---|---|---|---|
amount_column | integer | 50 | Column that amounts are right-aligned to. Postings longer than this keep a single separating space. |
indent | integer | 4 | Spaces before each posting line. Tabs are always expanded. |
currency_position | string | "suffix" | Either "prefix" or "suffix". Mixed input is normalised to one form. |
align_comments | bool | true | Align trailing ; comments within a transaction. |
blank_lines | integer | 1 | Blank lines kept between transactions. |
[files]
| Key | Type | Default | Description |
|---|---|---|---|
extensions | list | ["journal"] | Extensions picked up when walking a directory. |
follow_includes | bool | false | Also format files pulled in by include directives. |
Precedence
Command-line flags override the config file, which overrides the defaults. Use
--print-config to see the settings actually in effect:
$ ledgerfmt --print-config accounts.journal
amount_column = 52 (ledgerfmt.toml)
indent = 4 (default)
A malformed
ledgerfmt.toml is a hard error. ledgerfmt will not
silently fall back to defaults, because that would change the formatting of every file.