Skip to main content

Module config

Module config 

Source
Expand description

Layered TOML configuration: defaults → global file → project file → CLI.

The global file lives at $XDG_CONFIG_HOME/diffler/config.toml (fallback ~/.config/diffler/config.toml) on every OS, macOS included — unix-first, no platform dirs, so the config stays greppable and editable in one place.

literal ‘<’ is not bindable (no <lt> escape) — known v1 limit.

Structs§

CliOverrides
CLI flags that override file layers. Every flag maps to a config key.
Config
Merged effective configuration. Every field has a default so any layer (including all of them) may be absent.
EditorConfig
KeyPress
One key press in a chord, mirroring crossterm’s KeyEvent shape: an uppercase letter carries shift like the events crossterm delivers.
KeysConfig
Key remaps per screen and per transient: action (or sub-key) name → chord string. Defaults are empty; built-in bindings live in the keymap and config entries override them. The commit/branch/log_menu tables address the transient sub-keys (e.g. [keys.commit] amend = "m").
LoadedConfig
McpConfig
UiConfig

Enums§

ChordError
ConfigError
FileLayout
How a view lists files: a flat magit-style list (one row per file, full repo-relative path) or a collapsible directory tree.
Origin
Which layer last set a config key (dotted path, e.g. ui.theme).

Functions§

load
Load and merge all configuration layers. Missing files are fine; a file that exists but cannot be read or parsed is an error.
parse_chord
Parse a chord string: plain chars (q, V = shift), bracketed tokens (<c-r>, <a-x>, <cr>, <tab>, <esc>, <space>, <s-cr>), and concatenation for sequences (cc, <c-x><c-c>).
render_dump
Render the merged config as TOML followed by a comment block with the origin of every tracked key, for diffler config --dump.

Type Aliases§

Chord
A chord is one or more key presses in sequence (e.g. cc, <c-x><c-c>).