Documentation ¶
Index ¶
- func ConfigDir() string
- func LogPath() (string, error)
- type AppConfig
- func (c *AppConfig) ConfigFilename() string
- func (c *AppConfig) GetAppState() *AppState
- func (c *AppConfig) GetBuildDate() string
- func (c *AppConfig) GetBuildSource() string
- func (c *AppConfig) GetCommit() string
- func (c *AppConfig) GetDebug() bool
- func (c *AppConfig) GetIsNewRepo() bool
- func (c *AppConfig) GetName() string
- func (c *AppConfig) GetUserConfig() *UserConfig
- func (c *AppConfig) GetUserConfigDir() string
- func (c *AppConfig) GetUserConfigPath() string
- func (c *AppConfig) GetVersion() string
- func (c *AppConfig) ReloadUserConfig() error
- func (c *AppConfig) SaveAppState() error
- func (c *AppConfig) SetIsNewRepo(toSet bool)
- type AppConfigurer
- type AppState
- type CommitLengthConfig
- type CommitPrefixConfig
- type CustomCommand
- type CustomCommandMenuOption
- type CustomCommandPrompt
- type GitConfig
- type GuiConfig
- type KeybindingBranchesConfig
- type KeybindingCommitFilesConfig
- type KeybindingCommitsConfig
- type KeybindingConfig
- type KeybindingFilesConfig
- type KeybindingMainConfig
- type KeybindingStashConfig
- type KeybindingStatusConfig
- type KeybindingSubmodulesConfig
- type KeybindingUniversalConfig
- type MergingConfig
- type OSConfig
- type PagingConfig
- type PullConfig
- type RefresherConfig
- type ThemeConfig
- type UpdateConfig
- type UserConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppConfig ¶
type AppConfig struct { Debug bool `long:"debug" env:"DEBUG" default:"false"` Version string `long:"version" env:"VERSION" default:"unversioned"` Commit string `long:"commit" env:"COMMIT"` BuildDate string `long:"build-date" env:"BUILD_DATE"` Name string `long:"name" env:"NAME" default:"lazygit"` BuildSource string `long:"build-source" env:"BUILD_SOURCE" default:""` UserConfig *UserConfig UserConfigDir string UserConfigPath string AppState *AppState IsNewRepo bool }
AppConfig contains the base configuration fields required for lazygit.
func NewAppConfig ¶ added in v0.1.65
func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool) (*AppConfig, error)
NewAppConfig makes a new app config
func NewDummyAppConfig ¶ added in v0.23.1
func NewDummyAppConfig() *AppConfig
NewDummyAppConfig creates a new dummy AppConfig for testing
func (*AppConfig) ConfigFilename ¶ added in v0.23.1
ConfigFilename returns the filename of the current config file
func (*AppConfig) GetAppState ¶ added in v0.2.0
GetAppState returns the app state
func (*AppConfig) GetBuildDate ¶
GetBuildDate returns debug flag
func (*AppConfig) GetBuildSource ¶ added in v0.2.0
GetBuildSource returns the source of the build. For builds from goreleaser this will be binaryBuild
func (*AppConfig) GetIsNewRepo ¶ added in v0.7.1
GetIsNewRepo returns known repo boolean
func (*AppConfig) GetUserConfig ¶ added in v0.1.65
func (c *AppConfig) GetUserConfig() *UserConfig
GetUserConfig returns the user config
func (*AppConfig) GetUserConfigDir ¶ added in v0.10.1
func (*AppConfig) GetUserConfigPath ¶ added in v0.23.1
GetUserConfig returns the user config
func (*AppConfig) GetVersion ¶
GetVersion returns debug flag
func (*AppConfig) ReloadUserConfig ¶ added in v0.26.1
func (*AppConfig) SaveAppState ¶ added in v0.2.0
SaveAppState marshalls the AppState struct and writes it to the disk
func (*AppConfig) SetIsNewRepo ¶ added in v0.7.1
SetIsNewRepo set if the current repo is known
type AppConfigurer ¶
type AppConfigurer interface { GetDebug() bool GetVersion() string GetCommit() string GetBuildDate() string GetName() string GetBuildSource() string GetUserConfig() *UserConfig GetUserConfigDir() string GetUserConfigPath() string GetAppState() *AppState SaveAppState() error SetIsNewRepo(bool) GetIsNewRepo() bool ReloadUserConfig() error }
AppConfigurer interface allows individual app config structs to inherit Fields from AppConfig and still be used by lazygit.
type AppState ¶ added in v0.2.0
AppState stores data between runs of the app like when the last update check was performed and which other repos have been checked out
type CommitLengthConfig ¶ added in v0.23.1
type CommitLengthConfig struct {
Show bool `yaml:"show"`
}
type CommitPrefixConfig ¶ added in v0.23.1
type CustomCommand ¶ added in v0.23.1
type CustomCommandMenuOption ¶ added in v0.23.1
type CustomCommandPrompt ¶ added in v0.23.1
type CustomCommandPrompt struct { Type string `yaml:"type"` // one of 'input' and 'menu' Title string `yaml:"title"` // this only apply to prompts InitialValue string `yaml:"initialValue"` // this only applies to menus Options []CustomCommandMenuOption }
type GitConfig ¶ added in v0.23.1
type GitConfig struct { Paging PagingConfig `yaml:"paging"` Merging MergingConfig `yaml:"merging"` Pull PullConfig `yaml:"pull"` SkipHookPrefix string `yaml:"skipHookPrefix"` AutoFetch bool `yaml:"autoFetch"` BranchLogCmd string `yaml:"branchLogCmd"` AllBranchesLogCmd string `yaml:"allBranchesLogCmd"` OverrideGpg bool `yaml:"overrideGpg"` DisableForcePushing bool `yaml:"disableForcePushing"` CommitPrefixes map[string]CommitPrefixConfig `yaml:"commitPrefixes"` }
type GuiConfig ¶ added in v0.23.1
type GuiConfig struct { ScrollHeight int `yaml:"scrollHeight"` ScrollPastBottom bool `yaml:"scrollPastBottom"` MouseEvents bool `yaml:"mouseEvents"` SkipUnstageLineWarning bool `yaml:"skipUnstageLineWarning"` SkipStashWarning bool `yaml:"skipStashWarning"` SidePanelWidth float64 `yaml:"sidePanelWidth"` ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"` MainPanelSplitMode string `yaml:"mainPanelSplitMode"` Theme ThemeConfig `yaml:"theme"` CommitLength CommitLengthConfig `yaml:"commitLength"` SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"` ShowFileTree bool `yaml:"showFileTree"` }
type KeybindingBranchesConfig ¶ added in v0.23.1
type KeybindingBranchesConfig struct { CreatePullRequest string `yaml:"createPullRequest"` CopyPullRequestURL string `yaml:"copyPullRequestURL"` CheckoutBranchByName string `yaml:"checkoutBranchByName"` ForceCheckoutBranch string `yaml:"forceCheckoutBranch"` RebaseBranch string `yaml:"rebaseBranch"` RenameBranch string `yaml:"renameBranch"` MergeIntoCurrentBranch string `yaml:"mergeIntoCurrentBranch"` ViewGitFlowOptions string `yaml:"viewGitFlowOptions"` FastForward string `yaml:"fastForward"` PushTag string `yaml:"pushTag"` SetUpstream string `yaml:"setUpstream"` FetchRemote string `yaml:"fetchRemote"` }
type KeybindingCommitFilesConfig ¶ added in v0.23.1
type KeybindingCommitFilesConfig struct {
CheckoutCommitFile string `yaml:"checkoutCommitFile"`
}
type KeybindingCommitsConfig ¶ added in v0.23.1
type KeybindingCommitsConfig struct { SquashDown string `yaml:"squashDown"` RenameCommit string `yaml:"renameCommit"` RenameCommitWithEditor string `yaml:"renameCommitWithEditor"` ViewResetOptions string `yaml:"viewResetOptions"` MarkCommitAsFixup string `yaml:"markCommitAsFixup"` CreateFixupCommit string `yaml:"createFixupCommit"` SquashAboveCommits string `yaml:"squashAboveCommits"` MoveDownCommit string `yaml:"moveDownCommit"` MoveUpCommit string `yaml:"moveUpCommit"` AmendToCommit string `yaml:"amendToCommit"` PickCommit string `yaml:"pickCommit"` RevertCommit string `yaml:"revertCommit"` CherryPickCopy string `yaml:"cherryPickCopy"` CherryPickCopyRange string `yaml:"cherryPickCopyRange"` PasteCommits string `yaml:"pasteCommits"` TagCommit string `yaml:"tagCommit"` CheckoutCommit string `yaml:"checkoutCommit"` ResetCherryPick string `yaml:"resetCherryPick"` CopyCommitMessageToClipboard string `yaml:"copyCommitMessageToClipboard"` }
type KeybindingConfig ¶ added in v0.23.1
type KeybindingConfig struct { Universal KeybindingUniversalConfig `yaml:"universal"` Status KeybindingStatusConfig `yaml:"status"` Files KeybindingFilesConfig `yaml:"files"` Branches KeybindingBranchesConfig `yaml:"branches"` Commits KeybindingCommitsConfig `yaml:"commits"` Stash KeybindingStashConfig `yaml:"stash"` CommitFiles KeybindingCommitFilesConfig `yaml:"commitFiles"` Main KeybindingMainConfig `yaml:"main"` Submodules KeybindingSubmodulesConfig `yaml:"submodules"` }
type KeybindingFilesConfig ¶ added in v0.23.1
type KeybindingFilesConfig struct { CommitChanges string `yaml:"commitChanges"` CommitChangesWithoutHook string `yaml:"commitChangesWithoutHook"` AmendLastCommit string `yaml:"amendLastCommit"` CommitChangesWithEditor string `yaml:"commitChangesWithEditor"` IgnoreFile string `yaml:"ignoreFile"` RefreshFiles string `yaml:"refreshFiles"` StashAllChanges string `yaml:"stashAllChanges"` ViewStashOptions string `yaml:"viewStashOptions"` ToggleStagedAll string `yaml:"toggleStagedAll"` ViewResetOptions string `yaml:"viewResetOptions"` Fetch string `yaml:"fetch"` ToggleTreeView string `yaml:"toggleTreeView"` }
type KeybindingMainConfig ¶ added in v0.23.1
type KeybindingStashConfig ¶ added in v0.23.1
type KeybindingStashConfig struct {
PopStash string `yaml:"popStash"`
}
type KeybindingStatusConfig ¶ added in v0.23.1
type KeybindingSubmodulesConfig ¶ added in v0.23.1
type KeybindingUniversalConfig ¶ added in v0.23.1
type KeybindingUniversalConfig struct { Quit string `yaml:"quit"` QuitAlt1 string `yaml:"quit-alt1"` Return string `yaml:"return"` QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"` TogglePanel string `yaml:"togglePanel"` PrevItem string `yaml:"prevItem"` NextItem string `yaml:"nextItem"` PrevItemAlt string `yaml:"prevItem-alt"` NextItemAlt string `yaml:"nextItem-alt"` PrevPage string `yaml:"prevPage"` NextPage string `yaml:"nextPage"` GotoTop string `yaml:"gotoTop"` GotoBottom string `yaml:"gotoBottom"` PrevBlock string `yaml:"prevBlock"` NextBlock string `yaml:"nextBlock"` PrevBlockAlt string `yaml:"prevBlock-alt"` NextBlockAlt string `yaml:"nextBlock-alt"` NextMatch string `yaml:"nextMatch"` PrevMatch string `yaml:"prevMatch"` StartSearch string `yaml:"startSearch"` OptionMenu string `yaml:"optionMenu"` OptionMenuAlt1 string `yaml:"optionMenu-alt1"` Select string `yaml:"select"` GoInto string `yaml:"goInto"` Confirm string `yaml:"confirm"` ConfirmAlt1 string `yaml:"confirm-alt1"` Remove string `yaml:"remove"` New string `yaml:"new"` Edit string `yaml:"edit"` OpenFile string `yaml:"openFile"` ScrollUpMain string `yaml:"scrollUpMain"` ScrollDownMain string `yaml:"scrollDownMain"` ScrollUpMainAlt1 string `yaml:"scrollUpMain-alt1"` ScrollDownMainAlt1 string `yaml:"scrollDownMain-alt1"` ScrollUpMainAlt2 string `yaml:"scrollUpMain-alt2"` ScrollDownMainAlt2 string `yaml:"scrollDownMain-alt2"` ExecuteCustomCommand string `yaml:"executeCustomCommand"` CreateRebaseOptionsMenu string `yaml:"createRebaseOptionsMenu"` PushFiles string `yaml:"pushFiles"` PullFiles string `yaml:"pullFiles"` Refresh string `yaml:"refresh"` CreatePatchOptionsMenu string `yaml:"createPatchOptionsMenu"` NextTab string `yaml:"nextTab"` PrevTab string `yaml:"prevTab"` NextScreenMode string `yaml:"nextScreenMode"` PrevScreenMode string `yaml:"prevScreenMode"` Undo string `yaml:"undo"` Redo string `yaml:"redo"` FilteringMenu string `yaml:"filteringMenu"` DiffingMenu string `yaml:"diffingMenu"` DiffingMenuAlt string `yaml:"diffingMenu-alt"` CopyToClipboard string `yaml:"copyToClipboard"` SubmitEditorText string `yaml:"submitEditorText"` AppendNewline string `yaml:"appendNewline"` }
type MergingConfig ¶ added in v0.23.1
type OSConfig ¶ added in v0.23.1
type OSConfig struct { // OpenCommand is the command for opening a file OpenCommand string `yaml:"openCommand,omitempty"` // OpenCommand is the command for opening a link OpenLinkCommand string `yaml:"openLinkCommand,omitempty"` }
OSConfig contains config on the level of the os
func GetPlatformDefaultConfig ¶ added in v0.2.2
func GetPlatformDefaultConfig() OSConfig
GetPlatformDefaultConfig gets the defaults for the platform
type PagingConfig ¶ added in v0.23.1
type PullConfig ¶ added in v0.23.1
type PullConfig struct {
Mode string `yaml:"mode"`
}
type RefresherConfig ¶ added in v0.25.1
type ThemeConfig ¶ added in v0.23.1
type ThemeConfig struct { LightTheme bool `yaml:"lightTheme"` ActiveBorderColor []string `yaml:"activeBorderColor"` InactiveBorderColor []string `yaml:"inactiveBorderColor"` OptionsTextColor []string `yaml:"optionsTextColor"` SelectedLineBgColor []string `yaml:"selectedLineBgColor"` SelectedRangeBgColor []string `yaml:"selectedRangeBgColor"` }
type UpdateConfig ¶ added in v0.23.1
type UserConfig ¶ added in v0.23.1
type UserConfig struct { Gui GuiConfig `yaml:"gui"` Git GitConfig `yaml:"git"` Update UpdateConfig `yaml:"update"` Refresher RefresherConfig `yaml:"refresher"` Reporting string `yaml:"reporting"` SplashUpdatesIndex int `yaml:"splashUpdatesIndex"` ConfirmOnQuit bool `yaml:"confirmOnQuit"` QuitOnTopLevelReturn bool `yaml:"quitOnTopLevelReturn"` Keybinding KeybindingConfig `yaml:"keybinding"` // OS determines what defaults are set for opening files and links OS OSConfig `yaml:"os,omitempty"` DisableStartupPopups bool `yaml:"disableStartupPopups"` CustomCommands []CustomCommand `yaml:"customCommands"` Services map[string]string `yaml:"services"` NotARepository string `yaml:"notARepository"` }
func GetDefaultConfig ¶ added in v0.2.0
func GetDefaultConfig() *UserConfig