Documentation
¶
Overview ¶
Package config handles user configuration files and custom theme definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CandidateConfigFilePaths ¶
CandidateConfigFilePaths returns config file paths to try in order of preference.
func ConfigDir ¶
ConfigDir returns the path to the diffmantic config directory, respecting $XDG_CONFIG_HOME or falling back to ~/.config/diffmantic.
func LoadExternalThemes ¶
func LoadExternalThemes(dir string) (map[string]ThemeConfig, error)
LoadExternalThemes loads all .yml and .yaml theme definitions from the given directory.
Types ¶
type ActionColorsConfig ¶
type ActionColorsConfig struct {
DeleteFg string `yaml:"delete_fg"`
InsertFg string `yaml:"insert_fg"`
UpdateFg string `yaml:"update_fg"`
MoveFg string `yaml:"move_fg"`
MoveUpdateFg string `yaml:"move_update_fg"`
DeleteBg string `yaml:"delete_bg"`
InsertBg string `yaml:"insert_bg"`
UpdateBg string `yaml:"update_bg"`
MoveBg string `yaml:"move_bg"`
MoveUpdateBg string `yaml:"move_update_bg"`
}
ActionColorsConfig defines hex colors for AST diff actions.
type Config ¶
type Config struct {
Theme string `yaml:"theme"`
ThemeStyle string `yaml:"theme_style"`
Format string `yaml:"format"`
IgnoreComments bool `yaml:"ignore_comments"`
ParseErrorLimit int `yaml:"parse_error_limit"`
TUI TUIConfig `yaml:"tui"`
Themes map[string]ThemeConfig `yaml:"themes"`
}
Config holds all user configuration settings for diffmantic.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the baseline configuration when no config file is found.
type TUIConfig ¶
type TUIConfig struct {
TabWidth int `yaml:"tab_width"`
Mouse bool `yaml:"mouse"`
Icons string `yaml:"icons"` // "unicode" | "ascii" | "nerd-font"
}
TUIConfig controls TUI layout, mouse support, and glyph styles.
type ThemeConfig ¶
type ThemeConfig struct {
Name string `yaml:"name"`
Dark *bool `yaml:"dark"`
UI UIColorsConfig `yaml:"ui"`
Actions ActionColorsConfig `yaml:"actions"`
}
ThemeConfig defines overrides for a color theme palette.
type UIColorsConfig ¶
type UIColorsConfig struct {
Base string `yaml:"base"`
Mantle string `yaml:"mantle"`
Crust string `yaml:"crust"`
Surface0 string `yaml:"surface0"`
Surface1 string `yaml:"surface1"`
Surface2 string `yaml:"surface2"`
Overlay0 string `yaml:"overlay0"`
Overlay1 string `yaml:"overlay1"`
Overlay2 string `yaml:"overlay2"`
Subtext0 string `yaml:"subtext0"`
Subtext1 string `yaml:"subtext1"`
Text string `yaml:"text"`
Lavender string `yaml:"lavender"`
Mauve string `yaml:"mauve"`
Blue string `yaml:"blue"`
Green string `yaml:"green"`
Peach string `yaml:"peach"`
Sky string `yaml:"sky"`
Yellow string `yaml:"yellow"`
Pink string `yaml:"pink"`
Red string `yaml:"red"`
Teal string `yaml:"teal"`
Rosewater string `yaml:"rosewater"`
Sapphire string `yaml:"sapphire"`
Maroon string `yaml:"maroon"`
Flamingo string `yaml:"flamingo"`
}
UIColorsConfig defines hex color overrides for TUI chrome.