2020-10-03 06:54:55 +02:00
|
|
|
package config
|
|
|
|
|
2022-05-13 14:56:07 +02:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type UserConfig struct {
|
|
|
|
Gui GuiConfig `yaml:"gui"`
|
|
|
|
Git GitConfig `yaml:"git"`
|
|
|
|
Update UpdateConfig `yaml:"update"`
|
2021-01-05 19:38:49 +02:00
|
|
|
Refresher RefresherConfig `yaml:"refresher"`
|
2020-10-04 00:53:56 +02:00
|
|
|
ConfirmOnQuit bool `yaml:"confirmOnQuit"`
|
|
|
|
QuitOnTopLevelReturn bool `yaml:"quitOnTopLevelReturn"`
|
|
|
|
Keybinding KeybindingConfig `yaml:"keybinding"`
|
|
|
|
// OS determines what defaults are set for opening files and links
|
2022-03-17 08:43:03 +02:00
|
|
|
OS OSConfig `yaml:"os,omitempty"`
|
|
|
|
DisableStartupPopups bool `yaml:"disableStartupPopups"`
|
|
|
|
CustomCommands []CustomCommand `yaml:"customCommands"`
|
|
|
|
Services map[string]string `yaml:"services"`
|
|
|
|
NotARepository string `yaml:"notARepository"`
|
|
|
|
PromptToReturnFromSubprocess bool `yaml:"promptToReturnFromSubprocess"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
2021-01-05 19:38:49 +02:00
|
|
|
type RefresherConfig struct {
|
|
|
|
RefreshInterval int `yaml:"refreshInterval"`
|
|
|
|
FetchInterval int `yaml:"fetchInterval"`
|
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type GuiConfig struct {
|
2023-07-11 13:48:18 +02:00
|
|
|
AuthorColors map[string]string `yaml:"authorColors"`
|
|
|
|
BranchColors map[string]string `yaml:"branchColors"`
|
|
|
|
ScrollHeight int `yaml:"scrollHeight"`
|
|
|
|
ScrollPastBottom bool `yaml:"scrollPastBottom"`
|
2023-08-09 18:34:43 +02:00
|
|
|
ScrollOffMargin int `yaml:"scrollOffMargin"`
|
2023-07-11 13:48:18 +02:00
|
|
|
MouseEvents bool `yaml:"mouseEvents"`
|
|
|
|
SkipDiscardChangeWarning bool `yaml:"skipDiscardChangeWarning"`
|
|
|
|
SkipStashWarning bool `yaml:"skipStashWarning"`
|
|
|
|
SidePanelWidth float64 `yaml:"sidePanelWidth"`
|
|
|
|
ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"`
|
|
|
|
MainPanelSplitMode string `yaml:"mainPanelSplitMode"`
|
|
|
|
Language string `yaml:"language"`
|
|
|
|
TimeFormat string `yaml:"timeFormat"`
|
|
|
|
ShortTimeFormat string `yaml:"shortTimeFormat"`
|
|
|
|
Theme ThemeConfig `yaml:"theme"`
|
|
|
|
CommitLength CommitLengthConfig `yaml:"commitLength"`
|
|
|
|
SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"`
|
|
|
|
ShowListFooter bool `yaml:"showListFooter"`
|
|
|
|
ShowFileTree bool `yaml:"showFileTree"`
|
|
|
|
ShowRandomTip bool `yaml:"showRandomTip"`
|
|
|
|
ShowCommandLog bool `yaml:"showCommandLog"`
|
|
|
|
ShowBottomLine bool `yaml:"showBottomLine"`
|
|
|
|
ShowIcons bool `yaml:"showIcons"`
|
|
|
|
NerdFontsVersion string `yaml:"nerdFontsVersion"`
|
|
|
|
ShowBranchCommitHash bool `yaml:"showBranchCommitHash"`
|
|
|
|
CommandLogSize int `yaml:"commandLogSize"`
|
|
|
|
SplitDiff string `yaml:"splitDiff"`
|
|
|
|
SkipRewordInEditorWarning bool `yaml:"skipRewordInEditorWarning"`
|
|
|
|
WindowSize string `yaml:"windowSize"`
|
|
|
|
Border string `yaml:"border"`
|
2023-08-01 08:57:37 +02:00
|
|
|
AnimateExplosion bool `yaml:"animateExplosion"`
|
2020-10-03 06:54:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type ThemeConfig struct {
|
2023-06-03 06:11:03 +02:00
|
|
|
ActiveBorderColor []string `yaml:"activeBorderColor"`
|
|
|
|
InactiveBorderColor []string `yaml:"inactiveBorderColor"`
|
|
|
|
SearchingActiveBorderColor []string `yaml:"searchingActiveBorderColor"`
|
|
|
|
OptionsTextColor []string `yaml:"optionsTextColor"`
|
|
|
|
SelectedLineBgColor []string `yaml:"selectedLineBgColor"`
|
|
|
|
SelectedRangeBgColor []string `yaml:"selectedRangeBgColor"`
|
|
|
|
CherryPickedCommitBgColor []string `yaml:"cherryPickedCommitBgColor"`
|
|
|
|
CherryPickedCommitFgColor []string `yaml:"cherryPickedCommitFgColor"`
|
2023-06-11 08:08:55 +02:00
|
|
|
MarkedBaseCommitBgColor []string `yaml:"markedBaseCommitBgColor"`
|
|
|
|
MarkedBaseCommitFgColor []string `yaml:"markedBaseCommitFgColor"`
|
2023-06-03 06:11:03 +02:00
|
|
|
UnstagedChangesColor []string `yaml:"unstagedChangesColor"`
|
|
|
|
DefaultFgColor []string `yaml:"defaultFgColor"`
|
2020-10-03 06:54:55 +02:00
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type CommitLengthConfig struct {
|
|
|
|
Show bool `yaml:"show"`
|
2020-10-03 06:54:55 +02:00
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type GitConfig struct {
|
|
|
|
Paging PagingConfig `yaml:"paging"`
|
2021-11-14 15:31:15 +02:00
|
|
|
Commit CommitConfig `yaml:"commit"`
|
2020-10-04 00:53:56 +02:00
|
|
|
Merging MergingConfig `yaml:"merging"`
|
2023-05-09 21:41:25 +02:00
|
|
|
MainBranches []string `yaml:"mainBranches"`
|
2020-10-04 00:53:56 +02:00
|
|
|
SkipHookPrefix string `yaml:"skipHookPrefix"`
|
|
|
|
AutoFetch bool `yaml:"autoFetch"`
|
2022-03-26 19:10:58 +02:00
|
|
|
AutoRefresh bool `yaml:"autoRefresh"`
|
2023-03-01 10:09:35 +02:00
|
|
|
FetchAll bool `yaml:"fetchAll"`
|
2020-10-04 00:53:56 +02:00
|
|
|
BranchLogCmd string `yaml:"branchLogCmd"`
|
2020-11-27 09:07:14 +02:00
|
|
|
AllBranchesLogCmd string `yaml:"allBranchesLogCmd"`
|
2020-10-04 00:53:56 +02:00
|
|
|
OverrideGpg bool `yaml:"overrideGpg"`
|
|
|
|
DisableForcePushing bool `yaml:"disableForcePushing"`
|
|
|
|
CommitPrefixes map[string]CommitPrefixConfig `yaml:"commitPrefixes"`
|
2022-04-03 22:19:15 +02:00
|
|
|
// this should really be under 'gui', not 'git'
|
2021-11-21 03:48:49 +02:00
|
|
|
ParseEmoji bool `yaml:"parseEmoji"`
|
|
|
|
Log LogConfig `yaml:"log"`
|
|
|
|
DiffContextSize int `yaml:"diffContextSize"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
2020-10-03 06:54:55 +02:00
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type PagingConfig struct {
|
|
|
|
ColorArg string `yaml:"colorArg"`
|
|
|
|
Pager string `yaml:"pager"`
|
|
|
|
UseConfig bool `yaml:"useConfig"`
|
|
|
|
}
|
2020-10-03 06:54:55 +02:00
|
|
|
|
2021-11-14 15:31:15 +02:00
|
|
|
type CommitConfig struct {
|
2023-05-23 15:55:57 +02:00
|
|
|
SignOff bool `yaml:"signOff"`
|
2021-11-14 15:31:15 +02:00
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type MergingConfig struct {
|
|
|
|
ManualCommit bool `yaml:"manualCommit"`
|
|
|
|
Args string `yaml:"args"`
|
|
|
|
}
|
|
|
|
|
2021-11-02 11:05:23 +02:00
|
|
|
type LogConfig struct {
|
2022-05-30 17:19:48 +02:00
|
|
|
Order string `yaml:"order"` // one of date-order, author-date-order, topo-order
|
|
|
|
ShowGraph string `yaml:"showGraph"` // one of always, never, when-maximised
|
|
|
|
ShowWholeGraph bool `yaml:"showWholeGraph"`
|
2021-11-02 11:05:23 +02:00
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
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"`
|
2023-07-16 11:39:53 +02:00
|
|
|
Worktrees KeybindingWorktreesConfig `yaml:"worktrees"`
|
2020-10-04 00:53:56 +02:00
|
|
|
Commits KeybindingCommitsConfig `yaml:"commits"`
|
|
|
|
Stash KeybindingStashConfig `yaml:"stash"`
|
|
|
|
CommitFiles KeybindingCommitFilesConfig `yaml:"commitFiles"`
|
|
|
|
Main KeybindingMainConfig `yaml:"main"`
|
|
|
|
Submodules KeybindingSubmodulesConfig `yaml:"submodules"`
|
|
|
|
}
|
|
|
|
|
2021-04-11 15:32:20 +02:00
|
|
|
// damn looks like we have some inconsistencies here with -alt and -alt1
|
2020-10-04 00:53:56 +02:00
|
|
|
type KeybindingUniversalConfig struct {
|
2021-10-17 19:22:59 +02:00
|
|
|
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"`
|
2021-11-02 11:35:53 +02:00
|
|
|
ScrollLeft string `yaml:"scrollLeft"`
|
|
|
|
ScrollRight string `yaml:"scrollRight"`
|
2021-10-17 19:22:59 +02:00
|
|
|
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"`
|
|
|
|
NextBlockAlt2 string `yaml:"nextBlock-alt2"`
|
|
|
|
PrevBlockAlt2 string `yaml:"prevBlock-alt2"`
|
|
|
|
JumpToBlock []string `yaml:"jumpToBlock"`
|
|
|
|
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"`
|
2023-01-21 13:38:14 +02:00
|
|
|
ConfirmInEditor string `yaml:"confirmInEditor"`
|
2021-10-17 19:22:59 +02:00
|
|
|
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"`
|
2023-02-19 02:42:00 +02:00
|
|
|
Push string `yaml:"pushFiles"` // 'Files' appended for legacy reasons
|
|
|
|
Pull string `yaml:"pullFiles"` // 'Files' appended for legacy reasons
|
2021-10-17 19:22:59 +02:00
|
|
|
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"`
|
|
|
|
OpenRecentRepos string `yaml:"openRecentRepos"`
|
|
|
|
SubmitEditorText string `yaml:"submitEditorText"`
|
|
|
|
ExtrasMenu string `yaml:"extrasMenu"`
|
|
|
|
ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"`
|
2021-09-11 20:42:23 +02:00
|
|
|
IncreaseContextInDiffView string `yaml:"increaseContextInDiffView"`
|
2021-09-11 19:35:17 +02:00
|
|
|
DecreaseContextInDiffView string `yaml:"decreaseContextInDiffView"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type KeybindingStatusConfig struct {
|
2020-11-27 09:07:14 +02:00
|
|
|
CheckForUpdate string `yaml:"checkForUpdate"`
|
|
|
|
RecentRepos string `yaml:"recentRepos"`
|
|
|
|
AllBranchesLogGraph string `yaml:"allBranchesLogGraph"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type KeybindingFilesConfig struct {
|
|
|
|
CommitChanges string `yaml:"commitChanges"`
|
|
|
|
CommitChangesWithoutHook string `yaml:"commitChangesWithoutHook"`
|
|
|
|
AmendLastCommit string `yaml:"amendLastCommit"`
|
|
|
|
CommitChangesWithEditor string `yaml:"commitChangesWithEditor"`
|
2022-11-30 10:36:35 +02:00
|
|
|
IgnoreFile string `yaml:"ignoreFile"`
|
2020-10-04 00:53:56 +02:00
|
|
|
RefreshFiles string `yaml:"refreshFiles"`
|
|
|
|
StashAllChanges string `yaml:"stashAllChanges"`
|
|
|
|
ViewStashOptions string `yaml:"viewStashOptions"`
|
|
|
|
ToggleStagedAll string `yaml:"toggleStagedAll"`
|
|
|
|
ViewResetOptions string `yaml:"viewResetOptions"`
|
|
|
|
Fetch string `yaml:"fetch"`
|
2021-03-20 23:41:06 +02:00
|
|
|
ToggleTreeView string `yaml:"toggleTreeView"`
|
2021-04-11 02:05:39 +02:00
|
|
|
OpenMergeTool string `yaml:"openMergeTool"`
|
2021-06-20 16:55:50 +02:00
|
|
|
OpenStatusFilter string `yaml:"openStatusFilter"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type KeybindingBranchesConfig struct {
|
|
|
|
CreatePullRequest string `yaml:"createPullRequest"`
|
2021-04-21 13:23:36 +02:00
|
|
|
ViewPullRequestOptions string `yaml:"viewPullRequestOptions"`
|
2020-11-10 21:57:50 +02:00
|
|
|
CopyPullRequestURL string `yaml:"copyPullRequestURL"`
|
2020-10-04 00:53:56 +02:00
|
|
|
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"`
|
2023-02-08 15:40:18 +02:00
|
|
|
CreateTag string `yaml:"createTag"`
|
2020-10-04 00:53:56 +02:00
|
|
|
PushTag string `yaml:"pushTag"`
|
|
|
|
SetUpstream string `yaml:"setUpstream"`
|
|
|
|
FetchRemote string `yaml:"fetchRemote"`
|
|
|
|
}
|
|
|
|
|
2023-07-16 11:39:53 +02:00
|
|
|
type KeybindingWorktreesConfig struct {
|
|
|
|
ViewWorktreeOptions string `yaml:"viewWorktreeOptions"`
|
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type KeybindingCommitsConfig struct {
|
2022-03-24 22:04:33 +02:00
|
|
|
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"`
|
2022-04-22 16:01:30 +02:00
|
|
|
ResetCommitAuthor string `yaml:"resetCommitAuthor"`
|
2022-03-24 22:04:33 +02:00
|
|
|
PickCommit string `yaml:"pickCommit"`
|
|
|
|
RevertCommit string `yaml:"revertCommit"`
|
|
|
|
CherryPickCopy string `yaml:"cherryPickCopy"`
|
|
|
|
CherryPickCopyRange string `yaml:"cherryPickCopyRange"`
|
|
|
|
PasteCommits string `yaml:"pasteCommits"`
|
2023-06-11 08:08:55 +02:00
|
|
|
MarkCommitAsBaseForRebase string `yaml:"markCommitAsBaseForRebase"`
|
2023-02-20 09:52:45 +02:00
|
|
|
CreateTag string `yaml:"tagCommit"`
|
2022-03-24 22:04:33 +02:00
|
|
|
CheckoutCommit string `yaml:"checkoutCommit"`
|
|
|
|
ResetCherryPick string `yaml:"resetCherryPick"`
|
|
|
|
CopyCommitAttributeToClipboard string `yaml:"copyCommitAttributeToClipboard"`
|
|
|
|
OpenLogMenu string `yaml:"openLogMenu"`
|
|
|
|
OpenInBrowser string `yaml:"openInBrowser"`
|
|
|
|
ViewBisectOptions string `yaml:"viewBisectOptions"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type KeybindingStashConfig struct {
|
2022-10-14 15:19:53 +02:00
|
|
|
PopStash string `yaml:"popStash"`
|
|
|
|
RenameStash string `yaml:"renameStash"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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"`
|
2022-05-04 14:20:45 +02:00
|
|
|
EditSelectHunk string `yaml:"editSelectHunk"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2023-03-26 14:04:09 +02:00
|
|
|
// Command for editing a file. Should contain "{{filename}}".
|
|
|
|
Edit string `yaml:"edit,omitempty"`
|
|
|
|
|
|
|
|
// Command for editing a file at a given line number. Should contain
|
|
|
|
// "{{filename}}", and may optionally contain "{{line}}".
|
|
|
|
EditAtLine string `yaml:"editAtLine,omitempty"`
|
|
|
|
|
|
|
|
// Same as EditAtLine, except that the command needs to wait until the
|
|
|
|
// window is closed.
|
|
|
|
EditAtLineAndWait string `yaml:"editAtLineAndWait,omitempty"`
|
|
|
|
|
2023-08-09 13:34:51 +02:00
|
|
|
// Whether lazygit suspends until an edit process returns
|
2023-03-26 14:04:09 +02:00
|
|
|
// Pointer to bool so that we can distinguish unset (nil) from false.
|
2023-08-09 13:34:51 +02:00
|
|
|
// We're naming this `editInTerminal` for backwards compatibility
|
|
|
|
SuspendOnEdit *bool `yaml:"editInTerminal,omitempty"`
|
2023-03-26 14:04:09 +02:00
|
|
|
|
2023-07-17 07:45:10 +02:00
|
|
|
// For opening a directory in an editor
|
|
|
|
OpenDirInEditor string `yaml:"openDirInEditor,omitempty"`
|
|
|
|
|
2023-03-26 14:04:09 +02:00
|
|
|
// A built-in preset that sets all of the above settings. Supported presets
|
|
|
|
// are defined in the getPreset function in editor_presets.go.
|
|
|
|
EditPreset string `yaml:"editPreset,omitempty"`
|
|
|
|
|
2023-03-28 18:00:40 +02:00
|
|
|
// Command for opening a file, as if the file is double-clicked. Should
|
|
|
|
// contain "{{filename}}", but doesn't support "{{line}}".
|
|
|
|
Open string `yaml:"open,omitempty"`
|
|
|
|
|
|
|
|
// Command for opening a link. Should contain "{{link}}".
|
|
|
|
OpenLink string `yaml:"openLink,omitempty"`
|
|
|
|
|
2023-03-26 14:04:09 +02:00
|
|
|
// --------
|
|
|
|
|
|
|
|
// The following configs are all deprecated and kept for backward
|
|
|
|
// compatibility. They will be removed in the future.
|
|
|
|
|
|
|
|
// EditCommand is the command for editing a file.
|
|
|
|
// Deprecated: use Edit instead. Note that semantics are different:
|
|
|
|
// EditCommand is just the command itself, whereas Edit contains a
|
|
|
|
// "{{filename}}" variable.
|
2021-05-20 08:44:58 +02:00
|
|
|
EditCommand string `yaml:"editCommand,omitempty"`
|
|
|
|
|
2021-08-04 11:43:34 +02:00
|
|
|
// EditCommandTemplate is the command template for editing a file
|
2023-03-26 14:04:09 +02:00
|
|
|
// Deprecated: use EditAtLine instead.
|
2021-08-04 11:43:34 +02:00
|
|
|
EditCommandTemplate string `yaml:"editCommandTemplate,omitempty"`
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
// OpenCommand is the command for opening a file
|
2023-03-28 18:00:40 +02:00
|
|
|
// Deprecated: use Open instead.
|
2020-10-04 00:53:56 +02:00
|
|
|
OpenCommand string `yaml:"openCommand,omitempty"`
|
|
|
|
|
2023-03-29 11:50:35 +02:00
|
|
|
// OpenLinkCommand is the command for opening a link
|
2023-03-28 18:00:40 +02:00
|
|
|
// Deprecated: use OpenLink instead.
|
2020-10-04 00:53:56 +02:00
|
|
|
OpenLinkCommand string `yaml:"openLinkCommand,omitempty"`
|
2023-07-16 10:57:02 +02:00
|
|
|
|
|
|
|
// CopyToClipboardCmd is the command for copying to clipboard
|
|
|
|
CopyToClipboardCmd string `yaml:"copyToClipboardCmd,omitempty"`
|
2020-10-03 06:54:55 +02:00
|
|
|
}
|
|
|
|
|
2023-07-13 10:36:39 +02:00
|
|
|
type CustomCommandAfterHook struct {
|
|
|
|
CheckForConflicts bool `yaml:"checkForConflicts"`
|
|
|
|
}
|
|
|
|
|
2020-10-03 06:54:55 +02:00
|
|
|
type CustomCommand struct {
|
2023-07-13 10:36:39 +02:00
|
|
|
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"`
|
|
|
|
Stream bool `yaml:"stream"`
|
|
|
|
ShowOutput bool `yaml:"showOutput"`
|
|
|
|
After CustomCommandAfterHook `yaml:"after"`
|
2020-10-03 06:54:55 +02:00
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type CustomCommandPrompt struct {
|
2022-08-14 11:15:21 +02:00
|
|
|
// one of 'input', 'menu', 'confirm', or 'menuFromCommand'
|
2023-05-29 14:46:18 +02:00
|
|
|
Type string `yaml:"type"`
|
|
|
|
Key string `yaml:"key"`
|
2020-10-04 00:53:56 +02:00
|
|
|
Title string `yaml:"title"`
|
|
|
|
|
2023-05-29 14:46:18 +02:00
|
|
|
// these only apply to input prompts
|
|
|
|
InitialValue string `yaml:"initialValue"`
|
|
|
|
Suggestions CustomCommandSuggestions `yaml:"suggestions"`
|
2020-10-04 00:53:56 +02:00
|
|
|
|
2022-06-25 07:37:10 +02:00
|
|
|
// this only applies to confirm prompts
|
|
|
|
Body string `yaml:"body"`
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
// this only applies to menus
|
|
|
|
Options []CustomCommandMenuOption
|
2021-07-17 19:02:11 +02:00
|
|
|
|
2021-07-18 19:38:06 +02:00
|
|
|
// this only applies to menuFromCommand
|
2021-08-06 11:53:32 +02:00
|
|
|
Command string `yaml:"command"`
|
|
|
|
Filter string `yaml:"filter"`
|
|
|
|
ValueFormat string `yaml:"valueFormat"`
|
|
|
|
LabelFormat string `yaml:"labelFormat"`
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
|
|
|
|
2023-05-29 14:46:18 +02:00
|
|
|
type CustomCommandSuggestions struct {
|
|
|
|
Preset string `yaml:"preset"`
|
|
|
|
Command string `yaml:"command"`
|
|
|
|
}
|
|
|
|
|
2020-10-04 00:53:56 +02:00
|
|
|
type CustomCommandMenuOption struct {
|
|
|
|
Name string `yaml:"name"`
|
|
|
|
Description string `yaml:"description"`
|
|
|
|
Value string `yaml:"value"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetDefaultConfig() *UserConfig {
|
|
|
|
return &UserConfig{
|
|
|
|
Gui: GuiConfig{
|
2023-04-17 17:32:10 +02:00
|
|
|
ScrollHeight: 2,
|
|
|
|
ScrollPastBottom: true,
|
2023-08-09 18:34:43 +02:00
|
|
|
ScrollOffMargin: 2,
|
2023-04-17 17:32:10 +02:00
|
|
|
MouseEvents: true,
|
|
|
|
SkipDiscardChangeWarning: false,
|
|
|
|
SkipStashWarning: false,
|
|
|
|
SidePanelWidth: 0.3333,
|
|
|
|
ExpandFocusedSidePanel: false,
|
|
|
|
MainPanelSplitMode: "flexible",
|
|
|
|
Language: "auto",
|
|
|
|
TimeFormat: "02 Jan 06",
|
|
|
|
ShortTimeFormat: time.Kitchen,
|
2020-10-04 00:53:56 +02:00
|
|
|
Theme: ThemeConfig{
|
2023-06-03 06:11:03 +02:00
|
|
|
ActiveBorderColor: []string{"green", "bold"},
|
|
|
|
SearchingActiveBorderColor: []string{"cyan", "bold"},
|
|
|
|
InactiveBorderColor: []string{"default"},
|
|
|
|
OptionsTextColor: []string{"blue"},
|
|
|
|
SelectedLineBgColor: []string{"blue"},
|
|
|
|
SelectedRangeBgColor: []string{"blue"},
|
|
|
|
CherryPickedCommitBgColor: []string{"cyan"},
|
|
|
|
CherryPickedCommitFgColor: []string{"blue"},
|
2023-06-11 08:08:55 +02:00
|
|
|
MarkedBaseCommitBgColor: []string{"yellow"},
|
|
|
|
MarkedBaseCommitFgColor: []string{"blue"},
|
2023-06-03 06:11:03 +02:00
|
|
|
UnstagedChangesColor: []string{"red"},
|
|
|
|
DefaultFgColor: []string{"default"},
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
2023-07-11 13:48:18 +02:00
|
|
|
CommitLength: CommitLengthConfig{Show: true},
|
|
|
|
SkipNoStagedFilesWarning: false,
|
|
|
|
ShowListFooter: true,
|
|
|
|
ShowCommandLog: true,
|
|
|
|
ShowBottomLine: true,
|
|
|
|
ShowFileTree: true,
|
|
|
|
ShowRandomTip: true,
|
|
|
|
ShowIcons: false,
|
|
|
|
NerdFontsVersion: "",
|
|
|
|
ShowBranchCommitHash: false,
|
|
|
|
CommandLogSize: 8,
|
|
|
|
SplitDiff: "auto",
|
|
|
|
SkipRewordInEditorWarning: false,
|
|
|
|
Border: "single",
|
2023-08-01 08:57:37 +02:00
|
|
|
AnimateExplosion: true,
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
|
|
|
Git: GitConfig{
|
|
|
|
Paging: PagingConfig{
|
|
|
|
ColorArg: "always",
|
|
|
|
Pager: "",
|
2022-03-19 00:38:49 +02:00
|
|
|
UseConfig: false,
|
|
|
|
},
|
2021-11-14 15:31:15 +02:00
|
|
|
Commit: CommitConfig{
|
|
|
|
SignOff: false,
|
|
|
|
},
|
2020-10-04 00:53:56 +02:00
|
|
|
Merging: MergingConfig{
|
|
|
|
ManualCommit: false,
|
|
|
|
Args: "",
|
|
|
|
},
|
2021-11-02 11:05:23 +02:00
|
|
|
Log: LogConfig{
|
2022-05-30 17:19:48 +02:00
|
|
|
Order: "topo-order",
|
|
|
|
ShowGraph: "when-maximised",
|
2022-05-30 07:52:39 +02:00
|
|
|
ShowWholeGraph: false,
|
2021-11-02 11:05:23 +02:00
|
|
|
},
|
2020-10-04 00:53:56 +02:00
|
|
|
SkipHookPrefix: "WIP",
|
2023-05-09 21:41:25 +02:00
|
|
|
MainBranches: []string{"master", "main"},
|
2020-10-04 00:53:56 +02:00
|
|
|
AutoFetch: true,
|
2022-03-26 19:10:58 +02:00
|
|
|
AutoRefresh: true,
|
2023-03-01 10:09:35 +02:00
|
|
|
FetchAll: true,
|
2020-10-04 00:53:56 +02:00
|
|
|
BranchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --",
|
2020-11-27 09:07:14 +02:00
|
|
|
AllBranchesLogCmd: "git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium",
|
2020-10-04 00:53:56 +02:00
|
|
|
DisableForcePushing: false,
|
|
|
|
CommitPrefixes: map[string]CommitPrefixConfig(nil),
|
2021-07-16 14:06:01 +02:00
|
|
|
ParseEmoji: false,
|
2021-08-11 00:08:53 +02:00
|
|
|
DiffContextSize: 3,
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
2021-01-05 19:38:49 +02:00
|
|
|
Refresher: RefresherConfig{
|
|
|
|
RefreshInterval: 10,
|
|
|
|
FetchInterval: 60,
|
|
|
|
},
|
2020-10-04 00:53:56 +02:00
|
|
|
Update: UpdateConfig{
|
|
|
|
Method: "prompt",
|
|
|
|
Days: 14,
|
|
|
|
},
|
|
|
|
ConfirmOnQuit: false,
|
2021-04-06 01:23:47 +02:00
|
|
|
QuitOnTopLevelReturn: false,
|
2020-10-04 00:53:56 +02:00
|
|
|
Keybinding: KeybindingConfig{
|
|
|
|
Universal: KeybindingUniversalConfig{
|
|
|
|
Quit: "q",
|
|
|
|
QuitAlt1: "<c-c>",
|
|
|
|
Return: "<esc>",
|
|
|
|
QuitWithoutChangingDirectory: "Q",
|
|
|
|
TogglePanel: "<tab>",
|
|
|
|
PrevItem: "<up>",
|
|
|
|
NextItem: "<down>",
|
|
|
|
PrevItemAlt: "k",
|
|
|
|
NextItemAlt: "j",
|
|
|
|
PrevPage: ",",
|
|
|
|
NextPage: ".",
|
2021-11-02 11:35:53 +02:00
|
|
|
ScrollLeft: "H",
|
|
|
|
ScrollRight: "L",
|
2020-10-04 00:53:56 +02:00
|
|
|
GotoTop: "<",
|
|
|
|
GotoBottom: ">",
|
|
|
|
PrevBlock: "<left>",
|
|
|
|
NextBlock: "<right>",
|
|
|
|
PrevBlockAlt: "h",
|
|
|
|
NextBlockAlt: "l",
|
2021-04-11 15:32:20 +02:00
|
|
|
PrevBlockAlt2: "<backtab>",
|
|
|
|
NextBlockAlt2: "<tab>",
|
2021-10-17 19:22:59 +02:00
|
|
|
JumpToBlock: []string{"1", "2", "3", "4", "5"},
|
2020-10-04 00:53:56 +02:00
|
|
|
NextMatch: "n",
|
|
|
|
PrevMatch: "N",
|
|
|
|
StartSearch: "/",
|
2023-02-19 04:13:28 +02:00
|
|
|
OptionMenu: "",
|
2020-10-04 00:53:56 +02:00
|
|
|
OptionMenuAlt1: "?",
|
|
|
|
Select: "<space>",
|
|
|
|
GoInto: "<enter>",
|
|
|
|
Confirm: "<enter>",
|
2023-01-21 13:38:14 +02:00
|
|
|
ConfirmInEditor: "<a-enter>",
|
2020-10-04 00:53:56 +02:00
|
|
|
Remove: "d",
|
|
|
|
New: "n",
|
|
|
|
Edit: "e",
|
|
|
|
OpenFile: "o",
|
2021-05-27 16:22:33 +02:00
|
|
|
OpenRecentRepos: "<c-r>",
|
2020-10-04 00:53:56 +02:00
|
|
|
ScrollUpMain: "<pgup>",
|
|
|
|
ScrollDownMain: "<pgdown>",
|
|
|
|
ScrollUpMainAlt1: "K",
|
|
|
|
ScrollDownMainAlt1: "J",
|
|
|
|
ScrollUpMainAlt2: "<c-u>",
|
|
|
|
ScrollDownMainAlt2: "<c-d>",
|
|
|
|
ExecuteCustomCommand: ":",
|
|
|
|
CreateRebaseOptionsMenu: "m",
|
2023-02-19 02:42:00 +02:00
|
|
|
Push: "P",
|
|
|
|
Pull: "p",
|
2020-10-04 00:53:56 +02:00
|
|
|
Refresh: "R",
|
|
|
|
CreatePatchOptionsMenu: "<c-p>",
|
|
|
|
NextTab: "]",
|
|
|
|
PrevTab: "[",
|
|
|
|
NextScreenMode: "+",
|
|
|
|
PrevScreenMode: "_",
|
|
|
|
Undo: "z",
|
|
|
|
Redo: "<c-z>",
|
|
|
|
FilteringMenu: "<c-s>",
|
|
|
|
DiffingMenu: "W",
|
|
|
|
DiffingMenuAlt: "<c-e>",
|
|
|
|
CopyToClipboard: "<c-o>",
|
2020-10-12 23:16:24 +02:00
|
|
|
SubmitEditorText: "<enter>",
|
2021-04-11 04:12:54 +02:00
|
|
|
ExtrasMenu: "@",
|
2021-05-28 12:02:19 +02:00
|
|
|
ToggleWhitespaceInDiffView: "<c-w>",
|
2021-09-11 20:42:23 +02:00
|
|
|
IncreaseContextInDiffView: "}",
|
2021-09-11 19:35:17 +02:00
|
|
|
DecreaseContextInDiffView: "{",
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
|
|
|
Status: KeybindingStatusConfig{
|
2020-11-27 09:07:14 +02:00
|
|
|
CheckForUpdate: "u",
|
|
|
|
RecentRepos: "<enter>",
|
|
|
|
AllBranchesLogGraph: "a",
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
|
|
|
Files: KeybindingFilesConfig{
|
|
|
|
CommitChanges: "c",
|
|
|
|
CommitChangesWithoutHook: "w",
|
|
|
|
AmendLastCommit: "A",
|
|
|
|
CommitChangesWithEditor: "C",
|
2022-11-30 10:36:35 +02:00
|
|
|
IgnoreFile: "i",
|
2020-10-04 00:53:56 +02:00
|
|
|
RefreshFiles: "r",
|
|
|
|
StashAllChanges: "s",
|
|
|
|
ViewStashOptions: "S",
|
|
|
|
ToggleStagedAll: "a",
|
|
|
|
ViewResetOptions: "D",
|
|
|
|
Fetch: "f",
|
2021-03-20 23:41:06 +02:00
|
|
|
ToggleTreeView: "`",
|
2021-04-11 02:05:39 +02:00
|
|
|
OpenMergeTool: "M",
|
2021-06-20 16:55:50 +02:00
|
|
|
OpenStatusFilter: "<c-b>",
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
|
|
|
Branches: KeybindingBranchesConfig{
|
2020-11-18 05:08:32 +02:00
|
|
|
CopyPullRequestURL: "<c-y>",
|
2020-10-04 00:53:56 +02:00
|
|
|
CreatePullRequest: "o",
|
2021-04-21 13:23:36 +02:00
|
|
|
ViewPullRequestOptions: "O",
|
2020-10-04 00:53:56 +02:00
|
|
|
CheckoutBranchByName: "c",
|
|
|
|
ForceCheckoutBranch: "F",
|
|
|
|
RebaseBranch: "r",
|
|
|
|
RenameBranch: "R",
|
|
|
|
MergeIntoCurrentBranch: "M",
|
|
|
|
ViewGitFlowOptions: "i",
|
|
|
|
FastForward: "f",
|
2023-02-08 15:40:18 +02:00
|
|
|
CreateTag: "T",
|
2020-10-04 00:53:56 +02:00
|
|
|
PushTag: "P",
|
|
|
|
SetUpstream: "u",
|
|
|
|
FetchRemote: "f",
|
|
|
|
},
|
2023-07-16 11:39:53 +02:00
|
|
|
Worktrees: KeybindingWorktreesConfig{
|
|
|
|
ViewWorktreeOptions: "w",
|
|
|
|
},
|
2020-10-12 10:13:19 +02:00
|
|
|
Commits: KeybindingCommitsConfig{
|
2022-03-24 22:04:33 +02:00
|
|
|
SquashDown: "s",
|
|
|
|
RenameCommit: "r",
|
|
|
|
RenameCommitWithEditor: "R",
|
|
|
|
ViewResetOptions: "g",
|
|
|
|
MarkCommitAsFixup: "f",
|
|
|
|
CreateFixupCommit: "F",
|
|
|
|
SquashAboveCommits: "S",
|
|
|
|
MoveDownCommit: "<c-j>",
|
|
|
|
MoveUpCommit: "<c-k>",
|
|
|
|
AmendToCommit: "A",
|
2022-04-22 16:01:30 +02:00
|
|
|
ResetCommitAuthor: "a",
|
2022-03-24 22:04:33 +02:00
|
|
|
PickCommit: "p",
|
|
|
|
RevertCommit: "t",
|
|
|
|
CherryPickCopy: "c",
|
|
|
|
CherryPickCopyRange: "C",
|
|
|
|
PasteCommits: "v",
|
2023-06-11 08:08:55 +02:00
|
|
|
MarkCommitAsBaseForRebase: "B",
|
2023-02-20 09:52:45 +02:00
|
|
|
CreateTag: "T",
|
2022-03-24 22:04:33 +02:00
|
|
|
CheckoutCommit: "<space>",
|
|
|
|
ResetCherryPick: "<c-R>",
|
|
|
|
CopyCommitAttributeToClipboard: "y",
|
|
|
|
OpenLogMenu: "<c-l>",
|
|
|
|
OpenInBrowser: "o",
|
|
|
|
ViewBisectOptions: "b",
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
|
|
|
Stash: KeybindingStashConfig{
|
2022-10-14 15:19:53 +02:00
|
|
|
PopStash: "g",
|
|
|
|
RenameStash: "r",
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
|
|
|
CommitFiles: KeybindingCommitFilesConfig{
|
|
|
|
CheckoutCommitFile: "c",
|
|
|
|
},
|
|
|
|
Main: KeybindingMainConfig{
|
|
|
|
ToggleDragSelect: "v",
|
|
|
|
ToggleDragSelectAlt: "V",
|
|
|
|
ToggleSelectHunk: "a",
|
|
|
|
PickBothHunks: "b",
|
2022-05-04 14:20:45 +02:00
|
|
|
EditSelectHunk: "E",
|
2020-10-04 00:53:56 +02:00
|
|
|
},
|
|
|
|
Submodules: KeybindingSubmodulesConfig{
|
|
|
|
Init: "i",
|
|
|
|
Update: "u",
|
|
|
|
BulkMenu: "b",
|
|
|
|
},
|
|
|
|
},
|
2023-03-29 11:42:37 +02:00
|
|
|
OS: OSConfig{},
|
2022-03-17 08:43:03 +02:00
|
|
|
DisableStartupPopups: false,
|
|
|
|
CustomCommands: []CustomCommand(nil),
|
|
|
|
Services: map[string]string(nil),
|
|
|
|
NotARepository: "prompt",
|
|
|
|
PromptToReturnFromSubprocess: true,
|
2020-10-04 00:53:56 +02:00
|
|
|
}
|
2020-10-03 06:54:55 +02:00
|
|
|
}
|