config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolDefault

func BoolDefault(b *bool, def bool) bool

Types

type Config

type Config struct {
	DB      DBConfig      `toml:"db"`
	Filters FilterConfig  `toml:"filters"`
	Theme   ThemeConfig   `toml:"theme"`
	Display DisplayConfig `toml:"display"`
	Keys    KeyConfig     `toml:"keys"`
}

func Default

func Default() Config

func Load

func Load() (Config, error)

func (Config) DatabasePath

func (c Config) DatabasePath() string

func (Config) Save

func (c Config) Save() error

func (Config) Validate

func (c Config) Validate() error

type DBConfig

type DBConfig struct {
	Path string `toml:"path"`
}

type DisplayConfig

type DisplayConfig struct {
	TimeFormat        string `toml:"time_format"`
	DurationFormat    string `toml:"duration_format"`
	ShowHints         bool   `toml:"show_hints"`
	ShowDirectory     bool   `toml:"show_directory"`
	InstantExecute    bool   `toml:"instant_execute"`
	EnableFuzzy       bool   `toml:"enable_fuzzy"`
	EnableRegex       bool   `toml:"enable_regex"`
	EnableGlob        bool   `toml:"enable_glob"`
	CWDBoost          int    `toml:"cwd_boost"`
	DefaultScope      string `toml:"default_scope"`
	DefaultMode       string `toml:"default_mode"`
	HideMultiline     bool   `toml:"hide_multiline"`
	MultilinePreview  string `toml:"multiline_preview"`
	MultilineCollapse string `toml:"multiline_collapse"`
}

func DefaultDisplay

func DefaultDisplay() DisplayConfig

type FilterConfig

type FilterConfig struct {
	IgnoreSpace      bool     `toml:"ignore_space"`
	ExitCode         []int    `toml:"exit_code"`
	CommandGlob      []string `toml:"command_glob"`
	CommandRegex     []string `toml:"command_regex"`
	DirectoryGlob    []string `toml:"directory_glob"`
	DirectoryRegex   []string `toml:"directory_regex"`
	MaxCommandLength int      `toml:"max_command_length"`
}

type KeyConfig

type KeyConfig struct {
	ModeNext       string `toml:"mode_next"`
	ModeFuzzy      string `toml:"mode_fuzzy"`
	ModeRegex      string `toml:"mode_regex"`
	ModeGlob       string `toml:"mode_glob"`
	ToggleCWD      string `toml:"toggle_cwd"`
	ToggleDedupe   string `toml:"toggle_dedupe"`
	ToggleFails    string `toml:"toggle_fails"`
	Accept         string `toml:"accept"`
	Cancel         string `toml:"cancel"`
	Up             string `toml:"up"`
	Down           string `toml:"down"`
	PageUp         string `toml:"page_up"`
	PageDown       string `toml:"page_down"`
	Top            string `toml:"top"`
	Bottom         string `toml:"bottom"`
	Help           string `toml:"help"`
	PreviewCommand string `toml:"preview_command"`
}

func DefaultKeys

func DefaultKeys() KeyConfig

type ThemeConfig

type ThemeConfig struct {
	Prompt            string `toml:"prompt"`
	PromptColor       string `toml:"prompt_color"`
	MatchColor        string `toml:"match_color"`
	SelectedBg        string `toml:"selected_bg"`
	SelectedFg        string `toml:"selected_fg"`
	ModeColor         string `toml:"mode_color"`
	BorderColor       string `toml:"border_color"`
	MatchBold         *bool  `toml:"match_bold"`
	MatchUnderline    *bool  `toml:"match_underline"`
	MatchBg           string `toml:"match_bg"`
	SelectionBarShow  *bool  `toml:"selection_bar_show"`
	SelectionBarChar  string `toml:"selection_bar_char"`
	SelectionBarColor string `toml:"selection_bar_color"`
	SelectionFullLine *bool  `toml:"selection_full_line"`
}

func DefaultTheme

func DefaultTheme() ThemeConfig

Jump to

Keyboard shortcuts

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