config

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RepoConfigPath

func RepoConfigPath() string

RepoConfigPath returns the path to the repository config file

func UserConfigPath

func UserConfigPath() string

UserConfigPath returns the path to the user config file

Types

type Config

type Config struct {
	Theme       string      `yaml:"theme"`
	LineNumbers bool        `yaml:"line_numbers"`
	ContextMode string      `yaml:"context_mode"` // "focus" or "full"
	DiffMode    string      `yaml:"diff_mode"`    // "all", "staged", "unstaged"
	KeyBindings KeyBindings `yaml:"key_bindings,omitempty"`
}

Config represents the user configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration

func Load

func Load() (*Config, error)

Load loads configuration from disk, merging user and repo configs

func (*Config) Save

func (c *Config) Save() error

Save saves the configuration to the user config file

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration values are valid

type KeyBindings

type KeyBindings struct {
	Search            string `yaml:"search"`
	NextFile          string `yaml:"next_file"`
	PrevFile          string `yaml:"prev_file"`
	ToggleLineNumbers string `yaml:"toggle_line_numbers"`
	ToggleContext     string `yaml:"toggle_context"`
	Quit              string `yaml:"quit"`
}

KeyBindings defines custom key bindings

func DefaultKeyBindings

func DefaultKeyBindings() KeyBindings

DefaultKeyBindings returns the default key bindings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL