1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-19 12:12:42 +02:00

have typed default config

This commit is contained in:
Jesse Duffield 2020-10-04 09:53:56 +11:00
parent ca31e5258f
commit 7d9aa97f96
4 changed files with 424 additions and 380 deletions

10
main.go
View File

@ -48,6 +48,9 @@ func main() {
configFlag := false configFlag := false
flaggy.Bool(&configFlag, "c", "config", "Print the default config") flaggy.Bool(&configFlag, "c", "config", "Print the default config")
configDirFlag := false
flaggy.Bool(&configDirFlag, "cd", "config-dir", "Print the config directory")
workTree := "" workTree := ""
flaggy.String(&workTree, "w", "work-tree", "equivalent of the --work-tree git argument") flaggy.String(&workTree, "w", "work-tree", "equivalent of the --work-tree git argument")
@ -85,7 +88,12 @@ func main() {
if err != nil { if err != nil {
log.Fatal(err.Error()) log.Fatal(err.Error())
} }
fmt.Printf("%v\n", buf.String()) fmt.Printf("%s\n", buf.String())
os.Exit(0)
}
if configDirFlag {
fmt.Printf("%s\n", config.ConfigDir())
os.Exit(0) os.Exit(0)
} }

View File

@ -44,7 +44,7 @@ type AppConfigurer interface {
// NewAppConfig makes a new app config // NewAppConfig makes a new app config
func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool) (*AppConfig, error) { func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool) (*AppConfig, error) {
configDir, err := findOrCreateConfigDir(name) configDir, err := findOrCreateConfigDir()
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -80,11 +80,15 @@ func NewAppConfig(name, version, commit, date string, buildSource string, debugg
return appConfig, nil return appConfig, nil
} }
func findOrCreateConfigDir(projectName string) (string, error) { func ConfigDir() string {
// chucking my name there is not for vanity purposes, the xdg spec (and that // chucking my name there is not for vanity purposes, the xdg spec (and that
// function) requires a vendor name. May as well line up with github // function) requires a vendor name. May as well line up with github
configDirs := xdg.New("jesseduffield", projectName) configDirs := xdg.New("jesseduffield", "lazygit")
folder := configDirs.ConfigHome() return configDirs.ConfigHome()
}
func findOrCreateConfigDir() (string, error) {
folder := ConfigDir()
err := os.MkdirAll(folder, 0755) err := os.MkdirAll(folder, 0755)
if err != nil { if err != nil {
@ -186,7 +190,7 @@ func (c *AppConfig) GetUserConfigDir() string {
} }
func configFilePath(filename string) (string, error) { func configFilePath(filename string) (string, error) {
folder, err := findOrCreateConfigDir("lazygit") folder, err := findOrCreateConfigDir()
if err != nil { if err != nil {
return "", err return "", err
} }
@ -239,184 +243,6 @@ func loadAppState() (*AppState, error) {
return appState, nil return appState, nil
} }
func GetDefaultConfig() *UserConfig {
userConfig := &UserConfig{}
if err := yaml.Unmarshal(GetDefaultConfigBytes(), userConfig); err != nil {
panic(err)
}
userConfig.OS = GetPlatformDefaultConfig()
return userConfig
}
// GetDefaultConfigBytes returns the application default configuration
func GetDefaultConfigBytes() []byte {
return []byte(
`gui:
## stuff relating to the UI
scrollHeight: 2
scrollPastBottom: true
mouseEvents: true
skipUnstageLineWarning: false
skipStashWarning: true
sidePanelWidth: 0.3333
expandFocusedSidePanel: false
mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical'
theme:
lightTheme: false
activeBorderColor:
- green
- bold
inactiveBorderColor:
- white
optionsTextColor:
- blue
selectedLineBgColor:
- default
selectedRangeBgColor:
- blue
commitLength:
show: true
git:
paging:
colorArg: always
useConfig: false
merging:
manualCommit: false
args: ""
pull:
mode: 'merge' # one of 'merge' | 'rebase' | 'ff-only'
skipHookPrefix: 'WIP'
autoFetch: true
branchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --"
overrideGpg: false # prevents lazygit from spawning a separate process when using GPG
disableForcePushing: false
update:
method: prompt # can be: prompt | background | never
days: 14 # how often a update is checked for
reporting: 'undetermined' # one of: 'on' | 'off' | 'undetermined'
splashUpdatesIndex: 0
confirmOnQuit: false
quitOnTopLevelReturn: true
disableStartupPopups: false
keybinding:
universal:
quit: 'q'
quit-alt1: '<c-c>'
return: '<esc>'
quitWithoutChangingDirectory: 'Q'
togglePanel: '<tab>'
prevItem: '<up>'
nextItem: '<down>'
prevItem-alt: 'k'
nextItem-alt: 'j'
prevPage: ','
nextPage: '.'
gotoTop: '<'
gotoBottom: '>'
prevBlock: '<left>'
nextBlock: '<right>'
prevBlock-alt: 'h'
nextBlock-alt: 'l'
nextMatch: 'n'
prevMatch: 'N'
startSearch: '/'
optionMenu: 'x'
optionMenu-alt1: '?'
select: '<space>'
goInto: '<enter>'
confirm: '<enter>'
confirm-alt1: 'y'
remove: 'd'
new: 'n'
edit: 'e'
openFile: 'o'
scrollUpMain: '<pgup>'
scrollDownMain: '<pgdown>'
scrollUpMain-alt1: 'K'
scrollDownMain-alt1: 'J'
scrollUpMain-alt2: '<c-u>'
scrollDownMain-alt2: '<c-d>'
executeCustomCommand: ':'
createRebaseOptionsMenu: 'm'
pushFiles: 'P'
pullFiles: 'p'
refresh: 'R'
createPatchOptionsMenu: '<c-p>'
nextTab: ']'
prevTab: '['
nextScreenMode: '+'
prevScreenMode: '_'
undo: 'z'
redo: '<c-z>'
filteringMenu: <c-s>
diffingMenu: 'W'
diffingMenu-alt: '<c-e>'
copyToClipboard: '<c-o>'
status:
checkForUpdate: 'u'
recentRepos: '<enter>'
files:
commitChanges: 'c'
commitChangesWithoutHook: 'w'
amendLastCommit: 'A'
commitChangesWithEditor: 'C'
ignoreFile: 'i'
refreshFiles: 'r'
stashAllChanges: 's'
viewStashOptions: 'S'
toggleStagedAll: 'a'
viewResetOptions: 'D'
fetch: 'f'
branches:
createPullRequest: 'o'
checkoutBranchByName: 'c'
forceCheckoutBranch: 'F'
rebaseBranch: 'r'
renameBranch: 'R'
mergeIntoCurrentBranch: 'M'
viewGitFlowOptions: 'i'
fastForward: 'f'
pushTag: 'P'
setUpstream: 'u'
fetchRemote: 'f'
commits:
squashDown: 's'
renameCommit: 'r'
renameCommitWithEditor: 'R'
viewResetOptions: 'g'
markCommitAsFixup: 'f'
createFixupCommit: 'F'
squashAboveCommits: 'S'
moveDownCommit: '<c-j>'
moveUpCommit: '<c-k>'
amendToCommit: 'A'
pickCommit: 'p'
revertCommit: 't'
cherryPickCopy: 'c'
cherryPickCopyRange: 'C'
pasteCommits: 'v'
tagCommit: 'T'
checkoutCommit: '<space>'
resetCherryPick: '<c-R>'
stash:
popStash: 'g'
commitFiles:
checkoutCommitFile: 'c'
main:
toggleDragSelect: 'v'
toggleDragSelect-alt: 'V'
toggleSelectHunk: 'a'
pickBothHunks: 'b'
submodules:
init: 'i'
update: 'u'
bulkMenu: 'b'
`)
}
// AppState stores data between runs of the app like when the last update check // AppState stores data between runs of the app like when the last update check
// was performed and which other repos have been checked out // was performed and which other repos have been checked out
type AppState struct { type AppState struct {

View File

@ -1,10 +0,0 @@
package config
// OSConfig contains config on the level of the os
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"`
}

View File

@ -1,8 +1,32 @@
package config package config
type CommitPrefixConfig struct { type UserConfig struct {
Pattern string `yaml:"pattern"` Gui GuiConfig `yaml:"gui"`
Replace string `yaml:"replace"` Git GitConfig `yaml:"git"`
Update UpdateConfig `yaml:"update"`
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"`
}
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"`
} }
type ThemeConfig struct { type ThemeConfig struct {
@ -14,10 +38,206 @@ type ThemeConfig struct {
SelectedRangeBgColor []string `yaml:"selectedRangeBgColor"` SelectedRangeBgColor []string `yaml:"selectedRangeBgColor"`
} }
type CustomCommandMenuOption struct { type CommitLengthConfig struct {
Name string `yaml:"name"` Show bool `yaml:"show"`
Description string `yaml:"description"` }
Value string `yaml:"value"`
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"`
OverrideGpg bool `yaml:"overrideGpg"`
DisableForcePushing bool `yaml:"disableForcePushing"`
CommitPrefixes map[string]CommitPrefixConfig `yaml:"commitPrefixes"`
}
type PagingConfig struct {
ColorArg string `yaml:"colorArg"`
Pager string `yaml:"pager"`
UseConfig bool `yaml:"useConfig"`
}
type MergingConfig struct {
ManualCommit bool `yaml:"manualCommit"`
Args string `yaml:"args"`
}
type PullConfig struct {
Mode string `yaml:"mode"`
}
type CommitPrefixConfig struct {
Pattern string `yaml:"pattern"`
Replace string `yaml:"replace"`
}
type UpdateConfig struct {
Method string `yaml:"method"`
Days int64 `yaml:"days"`
}
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 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"`
}
type KeybindingStatusConfig struct {
CheckForUpdate string `yaml:"checkForUpdate"`
RecentRepos string `yaml:"recentRepos"`
}
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"`
}
type KeybindingBranchesConfig struct {
CreatePullRequest string `yaml:"createPullRequest"`
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 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"`
}
type KeybindingStashConfig struct {
PopStash string `yaml:"popStash"`
}
type KeybindingCommitFilesConfig struct {
CheckoutCommitFile string `yaml:"checkoutCommitFile"`
}
type KeybindingMainConfig struct {
ToggleDragSelect string `yaml:"toggleDragSelect"`
ToggleDragSelectAlt string `yaml:"toggleDragSelect-alt"`
ToggleSelectHunk string `yaml:"toggleSelectHunk"`
PickBothHunks string `yaml:"pickBothHunks"`
}
type KeybindingSubmodulesConfig struct {
Init string `yaml:"init"`
Update string `yaml:"update"`
BulkMenu string `yaml:"bulkMenu"`
}
// OSConfig contains config on the level of the os
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"`
}
type CustomCommand struct {
Key string `yaml:"key"`
Context string `yaml:"context"`
Command string `yaml:"command"`
Subprocess bool `yaml:"subprocess"`
Prompts []CustomCommandPrompt `yaml:"prompts"`
LoadingText string `yaml:"loadingText"`
Description string `yaml:"description"`
} }
type CustomCommandPrompt struct { type CustomCommandPrompt struct {
@ -31,185 +251,185 @@ type CustomCommandPrompt struct {
Options []CustomCommandMenuOption Options []CustomCommandMenuOption
} }
type CustomCommand struct { type CustomCommandMenuOption struct {
Key string `yaml:"key"` Name string `yaml:"name"`
Context string `yaml:"context"` Description string `yaml:"description"`
Command string `yaml:"command"` Value string `yaml:"value"`
Subprocess bool `yaml:"subprocess"`
Prompts []CustomCommandPrompt `yaml:"prompts"`
LoadingText string `yaml:"loadingText"`
Description string `yaml:"description"`
} }
type UserConfig struct { func GetDefaultConfig() *UserConfig {
Gui struct { return &UserConfig{
ScrollHeight int `yaml:"scrollHeight"` Gui: GuiConfig{
ScrollPastBottom bool `yaml:"scrollPastBottom"` ScrollHeight: 2,
MouseEvents bool `yaml:"mouseEvents"` ScrollPastBottom: true,
SkipUnstageLineWarning bool `yaml:"skipUnstageLineWarning"` MouseEvents: true,
SkipStashWarning bool `yaml:"skipStashWarning"` SkipUnstageLineWarning: false,
SidePanelWidth float64 `yaml:"sidePanelWidth"` SkipStashWarning: true,
ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"` SidePanelWidth: 0.3333,
MainPanelSplitMode string `yaml:"mainPanelSplitMode"` ExpandFocusedSidePanel: false,
Theme ThemeConfig `yaml:"theme"` MainPanelSplitMode: "flexible",
CommitLength struct { Theme: ThemeConfig{
Show bool `yaml:"show"` LightTheme: false,
} `yaml:"commitLength"` ActiveBorderColor: []string{"green", "bold"},
} `yaml:"gui"` InactiveBorderColor: []string{"white"},
Git struct { OptionsTextColor: []string{"blue"},
Paging struct { SelectedLineBgColor: []string{"default"},
ColorArg string `yaml:"colorArg"` SelectedRangeBgColor: []string{"blue"},
Pager string `yaml:"pager"` },
UseConfig bool `yaml:"useConfig"` CommitLength: CommitLengthConfig{Show: true},
} `yaml:"paging"` },
Merging struct { Git: GitConfig{
ManualCommit bool `yaml:"manualCommit"` Paging: PagingConfig{
Args string `yaml:"args"` ColorArg: "always",
} `yaml:"merging"` Pager: "",
Pull struct { UseConfig: false},
Mode string `yaml:"mode"` Merging: MergingConfig{
} `yaml:"pull"` ManualCommit: false,
SkipHookPrefix string `yaml:"skipHookPrefix"` Args: "",
AutoFetch bool `yaml:"autoFetch"` },
BranchLogCmd string `yaml:"branchLogCmd"` Pull: PullConfig{
OverrideGpg bool `yaml:"overrideGpg"` Mode: "merge",
DisableForcePushing bool `yaml:"disableForcePushing"` },
CommitPrefixes map[string]CommitPrefixConfig `yaml:"commitPrefixes"` SkipHookPrefix: "WIP",
} `yaml:"git"` AutoFetch: true,
Update struct { BranchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --",
Method string `yaml:"method"` OverrideGpg: false,
Days int64 `yaml:"days"` DisableForcePushing: false,
} `yaml:"update"` CommitPrefixes: map[string]CommitPrefixConfig(nil),
Reporting string `yaml:"reporting"` },
SplashUpdatesIndex int `yaml:"splashUpdatesIndex"` Update: UpdateConfig{
ConfirmOnQuit bool `yaml:"confirmOnQuit"` Method: "prompt",
QuitOnTopLevelReturn bool `yaml:"quitOnTopLevelReturn"` Days: 14,
Keybinding struct { },
Universal struct { Reporting: "undetermined",
Quit string `yaml:"quit"` SplashUpdatesIndex: 0,
QuitAlt1 string `yaml:"quit-alt1"` ConfirmOnQuit: false,
Return string `yaml:"return"` QuitOnTopLevelReturn: true,
QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"` Keybinding: KeybindingConfig{
TogglePanel string `yaml:"togglePanel"` Universal: KeybindingUniversalConfig{
PrevItem string `yaml:"prevItem"` Quit: "q",
NextItem string `yaml:"nextItem"` QuitAlt1: "<c-c>",
PrevItemAlt string `yaml:"prevItem-alt"` Return: "<esc>",
NextItemAlt string `yaml:"nextItem-alt"` QuitWithoutChangingDirectory: "Q",
PrevPage string `yaml:"prevPage"` TogglePanel: "<tab>",
NextPage string `yaml:"nextPage"` PrevItem: "<up>",
GotoTop string `yaml:"gotoTop"` NextItem: "<down>",
GotoBottom string `yaml:"gotoBottom"` PrevItemAlt: "k",
PrevBlock string `yaml:"prevBlock"` NextItemAlt: "j",
NextBlock string `yaml:"nextBlock"` PrevPage: ",",
PrevBlockAlt string `yaml:"prevBlock-alt"` NextPage: ".",
NextBlockAlt string `yaml:"nextBlock-alt"` GotoTop: "<",
NextMatch string `yaml:"nextMatch"` GotoBottom: ">",
PrevMatch string `yaml:"prevMatch"` PrevBlock: "<left>",
StartSearch string `yaml:"startSearch"` NextBlock: "<right>",
OptionMenu string `yaml:"optionMenu"` PrevBlockAlt: "h",
OptionMenuAlt1 string `yaml:"optionMenu-alt1"` NextBlockAlt: "l",
Select string `yaml:"select"` NextMatch: "n",
GoInto string `yaml:"goInto"` PrevMatch: "N",
Confirm string `yaml:"confirm"` StartSearch: "/",
ConfirmAlt1 string `yaml:"confirm-alt1"` OptionMenu: "x",
Remove string `yaml:"remove"` OptionMenuAlt1: "?",
New string `yaml:"new"` Select: "<space>",
Edit string `yaml:"edit"` GoInto: "<enter>",
OpenFile string `yaml:"openFile"` Confirm: "<enter>",
ScrollUpMain string `yaml:"scrollUpMain"` ConfirmAlt1: "y",
ScrollDownMain string `yaml:"scrollDownMain"` Remove: "d",
ScrollUpMainAlt1 string `yaml:"scrollUpMain-alt1"` New: "n",
ScrollDownMainAlt1 string `yaml:"scrollDownMain-alt1"` Edit: "e",
ScrollUpMainAlt2 string `yaml:"scrollUpMain-alt2"` OpenFile: "o",
ScrollDownMainAlt2 string `yaml:"scrollDownMain-alt2"` ScrollUpMain: "<pgup>",
ExecuteCustomCommand string `yaml:"executeCustomCommand"` ScrollDownMain: "<pgdown>",
CreateRebaseOptionsMenu string `yaml:"createRebaseOptionsMenu"` ScrollUpMainAlt1: "K",
PushFiles string `yaml:"pushFiles"` ScrollDownMainAlt1: "J",
PullFiles string `yaml:"pullFiles"` ScrollUpMainAlt2: "<c-u>",
Refresh string `yaml:"refresh"` ScrollDownMainAlt2: "<c-d>",
CreatePatchOptionsMenu string `yaml:"createPatchOptionsMenu"` ExecuteCustomCommand: ":",
NextTab string `yaml:"nextTab"` CreateRebaseOptionsMenu: "m",
PrevTab string `yaml:"prevTab"` PushFiles: "P",
NextScreenMode string `yaml:"nextScreenMode"` PullFiles: "p",
PrevScreenMode string `yaml:"prevScreenMode"` Refresh: "R",
Undo string `yaml:"undo"` CreatePatchOptionsMenu: "<c-p>",
Redo string `yaml:"redo"` NextTab: "]",
FilteringMenu string `yaml:"filteringMenu"` PrevTab: "[",
DiffingMenu string `yaml:"diffingMenu"` NextScreenMode: "+",
DiffingMenuAlt string `yaml:"diffingMenu-alt"` PrevScreenMode: "_",
CopyToClipboard string `yaml:"copyToClipboard"` Undo: "z",
} `yaml:"universal"` Redo: "<c-z>",
Status struct { FilteringMenu: "<c-s>",
CheckForUpdate string `yaml:"checkForUpdate"` DiffingMenu: "W",
RecentRepos string `yaml:"recentRepos"` DiffingMenuAlt: "<c-e>",
} `yaml:"status"` CopyToClipboard: "<c-o>",
Files struct { },
CommitChanges string `yaml:"commitChanges"` Status: KeybindingStatusConfig{
CommitChangesWithoutHook string `yaml:"commitChangesWithoutHook"` CheckForUpdate: "u",
AmendLastCommit string `yaml:"amendLastCommit"` RecentRepos: "<enter>",
CommitChangesWithEditor string `yaml:"commitChangesWithEditor"` },
IgnoreFile string `yaml:"ignoreFile"` Files: KeybindingFilesConfig{
RefreshFiles string `yaml:"refreshFiles"` CommitChanges: "c",
StashAllChanges string `yaml:"stashAllChanges"` CommitChangesWithoutHook: "w",
ViewStashOptions string `yaml:"viewStashOptions"` AmendLastCommit: "A",
ToggleStagedAll string `yaml:"toggleStagedAll"` CommitChangesWithEditor: "C",
ViewResetOptions string `yaml:"viewResetOptions"` IgnoreFile: "i",
Fetch string `yaml:"fetch"` RefreshFiles: "r",
} `yaml:"files"` StashAllChanges: "s",
Branches struct { ViewStashOptions: "S",
CreatePullRequest string `yaml:"createPullRequest"` ToggleStagedAll: "a",
CheckoutBranchByName string `yaml:"checkoutBranchByName"` ViewResetOptions: "D",
ForceCheckoutBranch string `yaml:"forceCheckoutBranch"` Fetch: "f",
RebaseBranch string `yaml:"rebaseBranch"` },
RenameBranch string `yaml:"renameBranch"` Branches: KeybindingBranchesConfig{
MergeIntoCurrentBranch string `yaml:"mergeIntoCurrentBranch"` CreatePullRequest: "o",
ViewGitFlowOptions string `yaml:"viewGitFlowOptions"` CheckoutBranchByName: "c",
FastForward string `yaml:"fastForward"` ForceCheckoutBranch: "F",
PushTag string `yaml:"pushTag"` RebaseBranch: "r",
SetUpstream string `yaml:"setUpstream"` RenameBranch: "R",
FetchRemote string `yaml:"fetchRemote"` MergeIntoCurrentBranch: "M",
} `yaml:"branches"` ViewGitFlowOptions: "i",
Commits struct { FastForward: "f",
SquashDown string `yaml:"squashDown"` PushTag: "P",
RenameCommit string `yaml:"renameCommit"` SetUpstream: "u",
RenameCommitWithEditor string `yaml:"renameCommitWithEditor"` FetchRemote: "f",
ViewResetOptions string `yaml:"viewResetOptions"` },
MarkCommitAsFixup string `yaml:"markCommitAsFixup"` Commits: KeybindingCommitsConfig{SquashDown: "s",
CreateFixupCommit string `yaml:"createFixupCommit"` RenameCommit: "r",
SquashAboveCommits string `yaml:"squashAboveCommits"` RenameCommitWithEditor: "R",
MoveDownCommit string `yaml:"moveDownCommit"` ViewResetOptions: "g",
MoveUpCommit string `yaml:"moveUpCommit"` MarkCommitAsFixup: "f",
AmendToCommit string `yaml:"amendToCommit"` CreateFixupCommit: "F",
PickCommit string `yaml:"pickCommit"` SquashAboveCommits: "S",
RevertCommit string `yaml:"revertCommit"` MoveDownCommit: "<c-j>",
CherryPickCopy string `yaml:"cherryPickCopy"` MoveUpCommit: "<c-k>",
CherryPickCopyRange string `yaml:"cherryPickCopyRange"` AmendToCommit: "A",
PasteCommits string `yaml:"pasteCommits"` PickCommit: "p",
TagCommit string `yaml:"tagCommit"` RevertCommit: "t",
CheckoutCommit string `yaml:"checkoutCommit"` CherryPickCopy: "c",
ResetCherryPick string `yaml:"resetCherryPick"` CherryPickCopyRange: "C",
} `yaml:"commits"` PasteCommits: "v",
Stash struct { TagCommit: "T",
PopStash string `yaml:"popStash"` CheckoutCommit: "<space>",
} `yaml:"stash"` ResetCherryPick: "<c-R>",
CommitFiles struct { },
CheckoutCommitFile string `yaml:"checkoutCommitFile"` Stash: KeybindingStashConfig{
} `yaml:"commitFiles"` PopStash: "g",
Main struct { },
ToggleDragSelect string `yaml:"toggleDragSelect"` CommitFiles: KeybindingCommitFilesConfig{
ToggleDragSelectAlt string `yaml:"toggleDragSelect-alt"` CheckoutCommitFile: "c",
ToggleSelectHunk string `yaml:"toggleSelectHunk"` },
PickBothHunks string `yaml:"pickBothHunks"` Main: KeybindingMainConfig{
} `yaml:"main"` ToggleDragSelect: "v",
Submodules struct { ToggleDragSelectAlt: "V",
Init string `yaml:"init"` ToggleSelectHunk: "a",
Update string `yaml:"update"` PickBothHunks: "b",
BulkMenu string `yaml:"bulkMenu"` },
} `yaml:"submodules"` Submodules: KeybindingSubmodulesConfig{
} `yaml:"keybinding"` Init: "i",
// OS determines what defaults are set for opening files and links Update: "u",
OS OSConfig `yaml:"os,omitempty"` BulkMenu: "b",
DisableStartupPopups bool `yaml:"disableStartupPopups"` },
CustomCommands []CustomCommand `yaml:"customCommands"` },
Services map[string]string `yaml:"services"` OS: GetPlatformDefaultConfig(),
DisableStartupPopups: false,
CustomCommands: []CustomCommand(nil),
Services: map[string]string(nil),
}
} }