Documentation
¶
Overview ¶
Package config loads application and repository configuration from YAML.
Index ¶
- func CustomThemesToThemeDataMap(customThemes map[string]*CustomTheme) map[string]*theme.CustomThemeData
- func DefaultDeltaArgsForTheme(themeName string) []string
- func NormalizeThemeName(name string) string
- func SaveConfig(cfg *AppConfig) error
- func SyntaxThemeForUITheme(themeName string) string
- type AppConfig
- type CustomCommand
- type CustomCreateMenu
- type CustomTheme
- type RepoConfig
- type TmuxCommand
- type TmuxWindow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomThemesToThemeDataMap ¶ added in v1.25.0
func CustomThemesToThemeDataMap(customThemes map[string]*CustomTheme) map[string]*theme.CustomThemeData
CustomThemesToThemeDataMap converts a map of CustomTheme to theme.CustomThemeData.
func DefaultDeltaArgsForTheme ¶ added in v1.8.0
DefaultDeltaArgsForTheme returns the default delta arguments for a given theme.
func NormalizeThemeName ¶ added in v1.8.0
NormalizeThemeName returns the normalized theme name if valid, otherwise empty string.
func SaveConfig ¶ added in v1.22.0
SaveConfig writes the configuration back to the file. It tries to preserve existing fields by reading the file first.
func SyntaxThemeForUITheme ¶ added in v1.6.0
SyntaxThemeForUITheme returns the syntax theme name for a given TUI theme.
Types ¶
type AppConfig ¶
type AppConfig struct {
WorktreeDir string
InitCommands []string
TerminateCommands []string
SortMode string // Sort mode: "path", "active" (commit date), "switched" (last accessed)
AutoFetchPRs bool
SearchAutoSelect bool // Start with filter focused and select first match on Enter.
MaxUntrackedDiffs int
MaxDiffChars int
MaxNameLength int // Maximum length for worktree names in table display (0 disables truncation)
GitPagerArgs []string
GitPagerArgsSet bool `yaml:"-"`
GitPager string
GitPagerInteractive bool // Interactive tools need terminal control, skip piping to less
TrustMode string
DebugLog string
Pager string
Editor string
AutoRefresh bool
RefreshIntervalSeconds int
CustomCommands map[string]*CustomCommand
BranchNameScript string // Script to generate branch name suggestions from diff
Theme string // Theme name: see AvailableThemes in internal/theme
MergeMethod string // Merge method for absorb: "rebase" or "merge" (default: "rebase")
FuzzyFinderInput bool // Enable fuzzy finder for input suggestions (default: false)
IconSet string // Icon set: "nerd-font-v3", "emoji", "text", "none" (default: "nerd-font-v3")
IssueBranchNameTemplate string // Template for issue branch names with placeholders: {number}, {title} (default: "issue-{number}-{title}")
PRBranchNameTemplate string // Template for PR branch names with placeholders: {number}, {title} (default: "pr-{number}-{title}")
SessionPrefix string // Prefix for tmux/zellij session names (default: "wt-")
PaletteMRU bool // Enable MRU sorting for command palette (default: false)
PaletteMRULimit int // Number of MRU items to show (default: 5)
CustomCreateMenus []*CustomCreateMenu
CustomThemes map[string]*CustomTheme // User-defined custom themes
ConfigPath string `yaml:"-"` // Path to the configuration file
}
AppConfig defines the global lazyworktree configuration options.
func DefaultConfig ¶
func DefaultConfig() *AppConfig
DefaultConfig returns the default configuration values.
func LoadConfig ¶
LoadConfig loads the application configuration from a file.
func (*AppConfig) ApplyCLIOverrides ¶ added in v1.24.0
ApplyCLIOverrides applies CLI config overrides to the configuration.
func (*AppConfig) IconsEnabled ¶ added in v1.27.0
IconsEnabled reports whether icon rendering should be enabled for the current icon set.
type CustomCommand ¶ added in v1.1.0
type CustomCommand struct {
Command string
Description string
ShowHelp bool
Wait bool
ShowOutput bool
Tmux *TmuxCommand
Zellij *TmuxCommand
}
CustomCommand represents a user-defined command binding.
type CustomCreateMenu ¶ added in v1.21.0
type CustomCreateMenu struct {
Label string // Display label in the menu
Description string // Help text shown next to label
Command string // Shell command that outputs branch name
Interactive bool // Run interactively (TUI suspends, captures stdout via temp file)
PostCommand string // Command to run after worktree creation (optional)
PostInteractive bool // Run post-command interactively (default: false)
}
CustomCreateMenu defines a custom entry in the worktree creation menu. The command should output a branch name that will be sanitized and used.
type CustomTheme ¶ added in v1.25.0
type CustomTheme struct {
Base string // Optional base theme name (built-in or custom)
Accent string
AccentFg string
AccentDim string
Border string
BorderDim string
MutedFg string
TextFg string
SuccessFg string
WarnFg string
ErrorFg string
Cyan string
}
CustomTheme represents a user-defined theme that can inherit from built-in or other custom themes.
func (*CustomTheme) ToThemeData ¶ added in v1.25.0
func (ct *CustomTheme) ToThemeData() *theme.CustomThemeData
ToThemeData converts CustomTheme to theme.CustomThemeData to avoid circular dependencies.
type RepoConfig ¶
RepoConfig represents repository-scoped commands from .wt
func LoadRepoConfig ¶
func LoadRepoConfig(repoPath string) (*RepoConfig, string, error)
LoadRepoConfig loads the repository configuration from a .wt file.
type TmuxCommand ¶ added in v1.7.0
type TmuxCommand struct {
SessionName string
Attach bool
OnExists string
Windows []TmuxWindow
}
TmuxCommand represents a configured tmux session layout.
type TmuxWindow ¶ added in v1.7.0
TmuxWindow represents a tmux window configuration.