make keybinds configurable and consolidate

This commit is contained in:
2026-07-28 14:55:38 +02:00
parent bb8e91039f
commit 948f3e1a79
12 changed files with 1469 additions and 158 deletions

View File

@@ -36,6 +36,7 @@ type Config struct {
Threads ThreadConfig `toml:"threads"`
Cache CacheConfig `toml:"cache"`
Editing EditingConfig `toml:"editing"`
KeyBindings KeyBindings `toml:"keybindings"`
}
type DisplayConfig struct {
@@ -85,8 +86,9 @@ func defaultConfig() Config {
StatusOrder: []string{"unresolved", "outdated", "resolved"},
WithinStatus: "file",
},
Cache: CacheConfig{Enabled: true, MaxAge: configDuration{7 * 24 * time.Hour}},
Editing: EditingConfig{Mode: "vim"},
Cache: CacheConfig{Enabled: true, MaxAge: configDuration{7 * 24 * time.Hour}},
Editing: EditingConfig{Mode: "vim"},
KeyBindings: defaultKeyBindings(),
}
}
@@ -181,6 +183,9 @@ func validateConfig(config Config) error {
default:
return fmt.Errorf("editing.mode must be standard or vim")
}
if err := validateKeyBindings(config.KeyBindings); err != nil {
return err
}
return nil
}