Documentation
¶
Overview ¶
Package config loads application and repository configuration from YAML.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
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)
ShowIcons bool // Render Nerd Font icons in file trees and PR views (default: true)
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
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.
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 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.