From 88e57fd4aac2c439f47aa6cd326153572357878f Mon Sep 17 00:00:00 2001 From: Karim Khaleel Date: Sun, 19 May 2024 13:47:15 +0300 Subject: [PATCH] Make Keybindings definition in UserConfig struct last This makes the generated default config in Config.md match the original order. --- docs/Config.md | 118 ++--- pkg/config/user_config.go | 20 +- schema/config.json | 998 +++++++++++++++++++------------------- 3 files changed, 568 insertions(+), 568 deletions(-) diff --git a/docs/Config.md b/docs/Config.md index f9c6a729b235..b9b325e9a65b 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -302,6 +302,65 @@ refresher: # Auto-fetch can be disabled via option 'git.autoFetch'. fetchInterval: 60 +# Config relating to things outside of Lazygit like how files are opened, copying to clipboard, etc +os: + # Command for editing a file. Should contain "{{filename}}". + edit: "" + + # Command for editing a file at a given line number. Should contain + # "{{filename}}", and may optionally contain "{{line}}". + editAtLine: "" + + # Same as EditAtLine, except that the command needs to wait until the + # window is closed. + editAtLineAndWait: "" + + # For opening a directory in an editor + openDirInEditor: "" + + # A built-in preset that sets all of the above settings. Supported presets + # are defined in the getPreset function in editor_presets.go. + editPreset: "" + + # Command for opening a file, as if the file is double-clicked. Should + # contain "{{filename}}", but doesn't support "{{line}}". + open: "" + + # Command for opening a link. Should contain "{{link}}". + openLink: "" + + # 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. + editCommand: "" + + # EditCommandTemplate is the command template for editing a file + # Deprecated: use EditAtLine instead. + editCommandTemplate: "" + + # OpenCommand is the command for opening a file + # Deprecated: use Open instead. + openCommand: "" + + # OpenLinkCommand is the command for opening a link + # Deprecated: use OpenLink instead. + openLinkCommand: "" + + # CopyToClipboardCmd is the command for copying to clipboard. + # See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-command-for-copying-to-clipboard + copyToClipboardCmd: "" + +# What to do when opening Lazygit outside of a git repo. +# - 'prompt': (default) ask whether to initialize a new repo or open in the most recent repo +# - 'create': initialize a new repo +# - 'skip': open most recent repo +# - 'quit': exit Lazygit +notARepository: prompt + +# If true, display a confirmation when subprocess terminates. This allows you to view the output of the subprocess before returning to Lazygit. +promptToReturnFromSubprocess: true + # Keybindings keybinding: universal: @@ -465,65 +524,6 @@ keybinding: bulkMenu: b commitMessage: commitMenu: - -# Config relating to things outside of Lazygit like how files are opened, copying to clipboard, etc -os: - # Command for editing a file. Should contain "{{filename}}". - edit: "" - - # Command for editing a file at a given line number. Should contain - # "{{filename}}", and may optionally contain "{{line}}". - editAtLine: "" - - # Same as EditAtLine, except that the command needs to wait until the - # window is closed. - editAtLineAndWait: "" - - # For opening a directory in an editor - openDirInEditor: "" - - # A built-in preset that sets all of the above settings. Supported presets - # are defined in the getPreset function in editor_presets.go. - editPreset: "" - - # Command for opening a file, as if the file is double-clicked. Should - # contain "{{filename}}", but doesn't support "{{line}}". - open: "" - - # Command for opening a link. Should contain "{{link}}". - openLink: "" - - # 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. - editCommand: "" - - # EditCommandTemplate is the command template for editing a file - # Deprecated: use EditAtLine instead. - editCommandTemplate: "" - - # OpenCommand is the command for opening a file - # Deprecated: use Open instead. - openCommand: "" - - # OpenLinkCommand is the command for opening a link - # Deprecated: use OpenLink instead. - openLinkCommand: "" - - # CopyToClipboardCmd is the command for copying to clipboard. - # See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-command-for-copying-to-clipboard - copyToClipboardCmd: "" - -# What to do when opening Lazygit outside of a git repo. -# - 'prompt': (default) ask whether to initialize a new repo or open in the most recent repo -# - 'create': initialize a new repo -# - 'skip': open most recent repo -# - 'quit': exit Lazygit -notARepository: prompt - -# If true, display a confirmation when subprocess terminates. This allows you to view the output of the subprocess before returning to Lazygit. -promptToReturnFromSubprocess: true ``` diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 4c0d50e5204a..2df6e60b88e0 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -19,8 +19,6 @@ type UserConfig struct { ConfirmOnQuit bool `yaml:"confirmOnQuit"` // If true, exit Lazygit when the user presses escape in a context where there is nothing to cancel/close QuitOnTopLevelReturn bool `yaml:"quitOnTopLevelReturn"` - // Keybindings - Keybinding KeybindingConfig `yaml:"keybinding"` // Config relating to things outside of Lazygit like how files are opened, copying to clipboard, etc OS OSConfig `yaml:"os,omitempty"` // If true, don't display introductory popups upon opening Lazygit. @@ -38,6 +36,8 @@ type UserConfig struct { NotARepository string `yaml:"notARepository" jsonschema:"enum=prompt,enum=create,enum=skip,enum=quit"` // If true, display a confirmation when subprocess terminates. This allows you to view the output of the subprocess before returning to Lazygit. PromptToReturnFromSubprocess bool `yaml:"promptToReturnFromSubprocess"` + // Keybindings + Keybinding KeybindingConfig `yaml:"keybinding"` } type RefresherConfig struct { @@ -736,8 +736,14 @@ func GetDefaultConfig() *UserConfig { Method: "prompt", Days: 14, }, - ConfirmOnQuit: false, - QuitOnTopLevelReturn: false, + ConfirmOnQuit: false, + QuitOnTopLevelReturn: false, + OS: OSConfig{}, + DisableStartupPopups: false, + CustomCommands: []CustomCommand(nil), + Services: map[string]string(nil), + NotARepository: "prompt", + PromptToReturnFromSubprocess: true, Keybinding: KeybindingConfig{ Universal: KeybindingUniversalConfig{ Quit: "q", @@ -904,11 +910,5 @@ func GetDefaultConfig() *UserConfig { CommitMenu: "", }, }, - OS: OSConfig{}, - DisableStartupPopups: false, - CustomCommands: []CustomCommand(nil), - Services: map[string]string(nil), - NotARepository: "prompt", - PromptToReturnFromSubprocess: true, } } diff --git a/schema/config.json b/schema/config.json index 556ce46077e8..9764e2286c69 100644 --- a/schema/config.json +++ b/schema/config.json @@ -680,6 +680,291 @@ "type": "boolean", "description": "If true, exit Lazygit when the user presses escape in a context where there is nothing to cancel/close" }, + "os": { + "properties": { + "edit": { + "type": "string", + "description": "Command for editing a file. Should contain \"{{filename}}\"." + }, + "editAtLine": { + "type": "string", + "description": "Command for editing a file at a given line number. Should contain\n\"{{filename}}\", and may optionally contain \"{{line}}\"." + }, + "editAtLineAndWait": { + "type": "string", + "description": "Same as EditAtLine, except that the command needs to wait until the\nwindow is closed." + }, + "editInTerminal": { + "type": "boolean", + "description": "Whether lazygit suspends until an edit process returns\nPointer to bool so that we can distinguish unset (nil) from false.\nWe're naming this `editInTerminal` for backwards compatibility" + }, + "openDirInEditor": { + "type": "string", + "description": "For opening a directory in an editor" + }, + "editPreset": { + "type": "string", + "description": "A built-in preset that sets all of the above settings. Supported presets\nare defined in the getPreset function in editor_presets.go.", + "examples": [ + "vim", + "nvim", + "emacs", + "nano", + "vscode", + "sublime", + "kakoune", + "helix", + "xcode" + ] + }, + "open": { + "type": "string", + "description": "Command for opening a file, as if the file is double-clicked. Should\ncontain \"{{filename}}\", but doesn't support \"{{line}}\"." + }, + "openLink": { + "type": "string", + "description": "Command for opening a link. Should contain \"{{link}}\"." + }, + "editCommand": { + "type": "string", + "description": "EditCommand is the command for editing a file.\nDeprecated: use Edit instead. Note that semantics are different:\nEditCommand is just the command itself, whereas Edit contains a\n\"{{filename}}\" variable." + }, + "editCommandTemplate": { + "type": "string", + "description": "EditCommandTemplate is the command template for editing a file\nDeprecated: use EditAtLine instead." + }, + "openCommand": { + "type": "string", + "description": "OpenCommand is the command for opening a file\nDeprecated: use Open instead." + }, + "openLinkCommand": { + "type": "string", + "description": "OpenLinkCommand is the command for opening a link\nDeprecated: use OpenLink instead." + }, + "copyToClipboardCmd": { + "type": "string", + "description": "CopyToClipboardCmd is the command for copying to clipboard.\nSee https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-command-for-copying-to-clipboard" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config relating to things outside of Lazygit like how files are opened, copying to clipboard, etc" + }, + "disableStartupPopups": { + "type": "boolean", + "description": "If true, don't display introductory popups upon opening Lazygit.\nLazygit sets this to true upon first runninng the program so that you don't see introductory popups every time you open the program." + }, + "customCommands": { + "items": { + "properties": { + "key": { + "type": "string", + "description": "The key to trigger the command. Use a single letter or one of the values from https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md" + }, + "context": { + "type": "string", + "enum": [ + "status", + "files", + "worktrees", + "localBranches", + "remotes", + "remoteBranches", + "tags", + "commits", + "reflogCommits", + "subCommits", + "commitFiles", + "stash", + "global" + ], + "description": "The context in which to listen for the key" + }, + "command": { + "type": "string", + "description": "The command to run (using Go template syntax for placeholder values)", + "examples": [ + "git fetch {{.Form.Remote}} {{.Form.Branch}} \u0026\u0026 git checkout FETCH_HEAD" + ] + }, + "subprocess": { + "type": "boolean", + "description": "If true, run the command in a subprocess (e.g. if the command requires user input)" + }, + "prompts": { + "items": { + "properties": { + "type": { + "type": "string", + "description": "One of: 'input' | 'menu' | 'confirm' | 'menuFromCommand'" + }, + "key": { + "type": "string", + "description": "Used to reference the entered value from within the custom command. E.g. a prompt with `key: 'Branch'` can be referred to as `{{.Form.Branch}}` in the command" + }, + "title": { + "type": "string", + "description": "The title to display in the popup panel" + }, + "initialValue": { + "type": "string", + "description": "The initial value to appear in the text box.\nOnly for input prompts." + }, + "suggestions": { + "properties": { + "preset": { + "type": "string", + "enum": [ + "authors", + "branches", + "files", + "refs", + "remotes", + "remoteBranches", + "tags" + ], + "description": "Uses built-in logic to obtain the suggestions. One of 'authors' | 'branches' | 'files' | 'refs' | 'remotes' | 'remoteBranches' | 'tags'" + }, + "command": { + "type": "string", + "description": "Command to run such that each line in the output becomes a suggestion. Mutually exclusive with 'preset' field.", + "examples": [ + "git fetch {{.Form.Remote}} {{.Form.Branch}} \u0026\u0026 git checkout FETCH_HEAD" + ] + } + }, + "additionalProperties": false, + "type": "object", + "description": "Shows suggestions as the input is entered\nOnly for input prompts." + }, + "body": { + "type": "string", + "description": "The message of the confirmation prompt.\nOnly for confirm prompts.", + "examples": [ + "Are you sure you want to push to the remote?" + ] + }, + "options": { + "items": { + "properties": { + "name": { + "type": "string", + "description": "The first part of the label" + }, + "description": { + "type": "string", + "description": "The second part of the label" + }, + "value": { + "type": "string", + "minLength": 1, + "description": "The value that will be used in the command", + "examples": [ + "feature" + ] + } + }, + "additionalProperties": false, + "type": "object" + }, + "type": "array", + "description": "Menu options.\nOnly for menu prompts." + }, + "command": { + "type": "string", + "description": "The command to run to generate menu options\nOnly for menuFromCommand prompts.", + "examples": [ + "git fetch {{.Form.Remote}} {{.Form.Branch}} \u0026\u0026 git checkout FETCH_HEAD" + ] + }, + "filter": { + "type": "string", + "description": "The regexp to run specifying groups which are going to be kept from the command's output.\nOnly for menuFromCommand prompts.", + "examples": [ + ".*{{.SelectedRemote.Name }}/(?P\u003cbranch\u003e.*)" + ] + }, + "valueFormat": { + "type": "string", + "description": "How to format matched groups from the filter to construct a menu item's value.\nOnly for menuFromCommand prompts.", + "examples": [ + "{{ .branch }}" + ] + }, + "labelFormat": { + "type": "string", + "description": "Like valueFormat but for the labels. If `labelFormat` is not specified, `valueFormat` is shown instead.\nOnly for menuFromCommand prompts.", + "examples": [ + "{{ .branch | green }}" + ] + } + }, + "additionalProperties": false, + "type": "object" + }, + "type": "array", + "description": "A list of prompts that will request user input before running the final command" + }, + "loadingText": { + "type": "string", + "description": "Text to display while waiting for command to finish", + "examples": [ + "Loading..." + ] + }, + "description": { + "type": "string", + "description": "Label for the custom command when displayed in the keybindings menu" + }, + "stream": { + "type": "boolean", + "description": "If true, stream the command's output to the Command Log panel" + }, + "showOutput": { + "type": "boolean", + "description": "If true, show the command's output in a popup within Lazygit" + }, + "after": { + "properties": { + "checkForConflicts": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Actions to take after the command has completed" + } + }, + "additionalProperties": false, + "type": "object" + }, + "type": "array", + "uniqueItems": true, + "description": "User-configured commands that can be invoked from within Lazygit" + }, + "services": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-pull-request-urls" + }, + "notARepository": { + "type": "string", + "enum": [ + "prompt", + "create", + "skip", + "quit" + ], + "description": "What to do when opening Lazygit outside of a git repo.\n- 'prompt': (default) ask whether to initialize a new repo or open in the most recent repo\n- 'create': initialize a new repo\n- 'skip': open most recent repo\n- 'quit': exit Lazygit", + "default": "prompt" + }, + "promptToReturnFromSubprocess": { + "type": "boolean", + "description": "If true, display a confirmation when subprocess terminates. This allows you to view the output of the subprocess before returning to Lazygit.", + "default": true + }, "keybinding": { "properties": { "universal": { @@ -1099,521 +1384,236 @@ }, "fastForward": { "type": "string", - "default": "f" - }, - "createTag": { - "type": "string", - "default": "T" - }, - "pushTag": { - "type": "string", - "default": "P" - }, - "setUpstream": { - "type": "string", - "default": "u" - }, - "fetchRemote": { - "type": "string", - "default": "f" - }, - "sortOrder": { - "type": "string", - "default": "s" - } - }, - "additionalProperties": false, - "type": "object" - }, - "worktrees": { - "properties": { - "viewWorktreeOptions": { - "type": "string", - "default": "w" - } - }, - "additionalProperties": false, - "type": "object" - }, - "commits": { - "properties": { - "squashDown": { - "type": "string", - "default": "s" - }, - "renameCommit": { - "type": "string", - "default": "r" - }, - "renameCommitWithEditor": { - "type": "string", - "default": "R" - }, - "viewResetOptions": { - "type": "string", - "default": "g" - }, - "markCommitAsFixup": { - "type": "string", - "default": "f" - }, - "createFixupCommit": { - "type": "string", - "default": "F" - }, - "squashAboveCommits": { - "type": "string", - "default": "S" - }, - "moveDownCommit": { - "type": "string", - "default": "\u003cc-j\u003e" - }, - "moveUpCommit": { - "type": "string", - "default": "\u003cc-k\u003e" - }, - "amendToCommit": { - "type": "string", - "default": "A" - }, - "resetCommitAuthor": { - "type": "string", - "default": "a" - }, - "pickCommit": { - "type": "string", - "default": "p" - }, - "revertCommit": { - "type": "string", - "default": "t" - }, - "cherryPickCopy": { - "type": "string", - "default": "C" - }, - "pasteCommits": { - "type": "string", - "default": "V" - }, - "markCommitAsBaseForRebase": { - "type": "string", - "default": "B" - }, - "tagCommit": { - "type": "string", - "default": "T" - }, - "checkoutCommit": { - "type": "string", - "default": "\u003cspace\u003e" - }, - "resetCherryPick": { - "type": "string", - "default": "\u003cc-R\u003e" - }, - "copyCommitAttributeToClipboard": { - "type": "string", - "default": "y" - }, - "openLogMenu": { - "type": "string", - "default": "\u003cc-l\u003e" - }, - "openInBrowser": { - "type": "string", - "default": "o" - }, - "viewBisectOptions": { - "type": "string", - "default": "b" - }, - "startInteractiveRebase": { - "type": "string", - "default": "i" - } - }, - "additionalProperties": false, - "type": "object" - }, - "amendAttribute": { - "properties": { - "resetAuthor": { - "type": "string", - "default": "a" - }, - "setAuthor": { - "type": "string", - "default": "A" - }, - "addCoAuthor": { - "type": "string", - "default": "c" - } - }, - "additionalProperties": false, - "type": "object" - }, - "stash": { - "properties": { - "popStash": { - "type": "string", - "default": "g" - }, - "renameStash": { - "type": "string", - "default": "r" - } - }, - "additionalProperties": false, - "type": "object" - }, - "commitFiles": { - "properties": { - "checkoutCommitFile": { - "type": "string", - "default": "c" - } - }, - "additionalProperties": false, - "type": "object" - }, - "main": { - "properties": { - "toggleSelectHunk": { - "type": "string", - "default": "a" - }, - "pickBothHunks": { - "type": "string", - "default": "b" - }, - "editSelectHunk": { - "type": "string", - "default": "E" - } - }, - "additionalProperties": false, - "type": "object" - }, - "submodules": { - "properties": { - "init": { + "default": "f" + }, + "createTag": { "type": "string", - "default": "i" + "default": "T" }, - "update": { + "pushTag": { "type": "string", - "default": "u" + "default": "P" }, - "bulkMenu": { + "setUpstream": { "type": "string", - "default": "b" - } - }, - "additionalProperties": false, - "type": "object" - }, - "commitMessage": { - "properties": { - "commitMenu": { + "default": "u" + }, + "fetchRemote": { "type": "string", - "default": "\u003cc-o\u003e" - } - }, - "additionalProperties": false, - "type": "object" - } - }, - "additionalProperties": false, - "type": "object", - "description": "Keybindings" - }, - "os": { - "properties": { - "edit": { - "type": "string", - "description": "Command for editing a file. Should contain \"{{filename}}\"." - }, - "editAtLine": { - "type": "string", - "description": "Command for editing a file at a given line number. Should contain\n\"{{filename}}\", and may optionally contain \"{{line}}\"." - }, - "editAtLineAndWait": { - "type": "string", - "description": "Same as EditAtLine, except that the command needs to wait until the\nwindow is closed." - }, - "editInTerminal": { - "type": "boolean", - "description": "Whether lazygit suspends until an edit process returns\nPointer to bool so that we can distinguish unset (nil) from false.\nWe're naming this `editInTerminal` for backwards compatibility" - }, - "openDirInEditor": { - "type": "string", - "description": "For opening a directory in an editor" - }, - "editPreset": { - "type": "string", - "description": "A built-in preset that sets all of the above settings. Supported presets\nare defined in the getPreset function in editor_presets.go.", - "examples": [ - "vim", - "nvim", - "emacs", - "nano", - "vscode", - "sublime", - "kakoune", - "helix", - "xcode" - ] - }, - "open": { - "type": "string", - "description": "Command for opening a file, as if the file is double-clicked. Should\ncontain \"{{filename}}\", but doesn't support \"{{line}}\"." - }, - "openLink": { - "type": "string", - "description": "Command for opening a link. Should contain \"{{link}}\"." - }, - "editCommand": { - "type": "string", - "description": "EditCommand is the command for editing a file.\nDeprecated: use Edit instead. Note that semantics are different:\nEditCommand is just the command itself, whereas Edit contains a\n\"{{filename}}\" variable." - }, - "editCommandTemplate": { - "type": "string", - "description": "EditCommandTemplate is the command template for editing a file\nDeprecated: use EditAtLine instead." - }, - "openCommand": { - "type": "string", - "description": "OpenCommand is the command for opening a file\nDeprecated: use Open instead." - }, - "openLinkCommand": { - "type": "string", - "description": "OpenLinkCommand is the command for opening a link\nDeprecated: use OpenLink instead." - }, - "copyToClipboardCmd": { - "type": "string", - "description": "CopyToClipboardCmd is the command for copying to clipboard.\nSee https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-command-for-copying-to-clipboard" - } - }, - "additionalProperties": false, - "type": "object", - "description": "Config relating to things outside of Lazygit like how files are opened, copying to clipboard, etc" - }, - "disableStartupPopups": { - "type": "boolean", - "description": "If true, don't display introductory popups upon opening Lazygit.\nLazygit sets this to true upon first runninng the program so that you don't see introductory popups every time you open the program." - }, - "customCommands": { - "items": { - "properties": { - "key": { - "type": "string", - "description": "The key to trigger the command. Use a single letter or one of the values from https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md" - }, - "context": { - "type": "string", - "enum": [ - "status", - "files", - "worktrees", - "localBranches", - "remotes", - "remoteBranches", - "tags", - "commits", - "reflogCommits", - "subCommits", - "commitFiles", - "stash", - "global" - ], - "description": "The context in which to listen for the key" - }, - "command": { - "type": "string", - "description": "The command to run (using Go template syntax for placeholder values)", - "examples": [ - "git fetch {{.Form.Remote}} {{.Form.Branch}} \u0026\u0026 git checkout FETCH_HEAD" - ] - }, - "subprocess": { - "type": "boolean", - "description": "If true, run the command in a subprocess (e.g. if the command requires user input)" - }, - "prompts": { - "items": { - "properties": { - "type": { - "type": "string", - "description": "One of: 'input' | 'menu' | 'confirm' | 'menuFromCommand'" - }, - "key": { - "type": "string", - "description": "Used to reference the entered value from within the custom command. E.g. a prompt with `key: 'Branch'` can be referred to as `{{.Form.Branch}}` in the command" - }, - "title": { - "type": "string", - "description": "The title to display in the popup panel" - }, - "initialValue": { - "type": "string", - "description": "The initial value to appear in the text box.\nOnly for input prompts." - }, - "suggestions": { - "properties": { - "preset": { - "type": "string", - "enum": [ - "authors", - "branches", - "files", - "refs", - "remotes", - "remoteBranches", - "tags" - ], - "description": "Uses built-in logic to obtain the suggestions. One of 'authors' | 'branches' | 'files' | 'refs' | 'remotes' | 'remoteBranches' | 'tags'" - }, - "command": { - "type": "string", - "description": "Command to run such that each line in the output becomes a suggestion. Mutually exclusive with 'preset' field.", - "examples": [ - "git fetch {{.Form.Remote}} {{.Form.Branch}} \u0026\u0026 git checkout FETCH_HEAD" - ] - } - }, - "additionalProperties": false, - "type": "object", - "description": "Shows suggestions as the input is entered\nOnly for input prompts." - }, - "body": { - "type": "string", - "description": "The message of the confirmation prompt.\nOnly for confirm prompts.", - "examples": [ - "Are you sure you want to push to the remote?" - ] - }, - "options": { - "items": { - "properties": { - "name": { - "type": "string", - "description": "The first part of the label" - }, - "description": { - "type": "string", - "description": "The second part of the label" - }, - "value": { - "type": "string", - "minLength": 1, - "description": "The value that will be used in the command", - "examples": [ - "feature" - ] - } - }, - "additionalProperties": false, - "type": "object" - }, - "type": "array", - "description": "Menu options.\nOnly for menu prompts." - }, - "command": { - "type": "string", - "description": "The command to run to generate menu options\nOnly for menuFromCommand prompts.", - "examples": [ - "git fetch {{.Form.Remote}} {{.Form.Branch}} \u0026\u0026 git checkout FETCH_HEAD" - ] - }, - "filter": { - "type": "string", - "description": "The regexp to run specifying groups which are going to be kept from the command's output.\nOnly for menuFromCommand prompts.", - "examples": [ - ".*{{.SelectedRemote.Name }}/(?P\u003cbranch\u003e.*)" - ] - }, - "valueFormat": { - "type": "string", - "description": "How to format matched groups from the filter to construct a menu item's value.\nOnly for menuFromCommand prompts.", - "examples": [ - "{{ .branch }}" - ] - }, - "labelFormat": { - "type": "string", - "description": "Like valueFormat but for the labels. If `labelFormat` is not specified, `valueFormat` is shown instead.\nOnly for menuFromCommand prompts.", - "examples": [ - "{{ .branch | green }}" - ] - } - }, - "additionalProperties": false, - "type": "object" + "default": "f" }, - "type": "array", - "description": "A list of prompts that will request user input before running the final command" + "sortOrder": { + "type": "string", + "default": "s" + } }, - "loadingText": { - "type": "string", - "description": "Text to display while waiting for command to finish", - "examples": [ - "Loading..." - ] + "additionalProperties": false, + "type": "object" + }, + "worktrees": { + "properties": { + "viewWorktreeOptions": { + "type": "string", + "default": "w" + } }, - "description": { - "type": "string", - "description": "Label for the custom command when displayed in the keybindings menu" + "additionalProperties": false, + "type": "object" + }, + "commits": { + "properties": { + "squashDown": { + "type": "string", + "default": "s" + }, + "renameCommit": { + "type": "string", + "default": "r" + }, + "renameCommitWithEditor": { + "type": "string", + "default": "R" + }, + "viewResetOptions": { + "type": "string", + "default": "g" + }, + "markCommitAsFixup": { + "type": "string", + "default": "f" + }, + "createFixupCommit": { + "type": "string", + "default": "F" + }, + "squashAboveCommits": { + "type": "string", + "default": "S" + }, + "moveDownCommit": { + "type": "string", + "default": "\u003cc-j\u003e" + }, + "moveUpCommit": { + "type": "string", + "default": "\u003cc-k\u003e" + }, + "amendToCommit": { + "type": "string", + "default": "A" + }, + "resetCommitAuthor": { + "type": "string", + "default": "a" + }, + "pickCommit": { + "type": "string", + "default": "p" + }, + "revertCommit": { + "type": "string", + "default": "t" + }, + "cherryPickCopy": { + "type": "string", + "default": "C" + }, + "pasteCommits": { + "type": "string", + "default": "V" + }, + "markCommitAsBaseForRebase": { + "type": "string", + "default": "B" + }, + "tagCommit": { + "type": "string", + "default": "T" + }, + "checkoutCommit": { + "type": "string", + "default": "\u003cspace\u003e" + }, + "resetCherryPick": { + "type": "string", + "default": "\u003cc-R\u003e" + }, + "copyCommitAttributeToClipboard": { + "type": "string", + "default": "y" + }, + "openLogMenu": { + "type": "string", + "default": "\u003cc-l\u003e" + }, + "openInBrowser": { + "type": "string", + "default": "o" + }, + "viewBisectOptions": { + "type": "string", + "default": "b" + }, + "startInteractiveRebase": { + "type": "string", + "default": "i" + } }, - "stream": { - "type": "boolean", - "description": "If true, stream the command's output to the Command Log panel" + "additionalProperties": false, + "type": "object" + }, + "amendAttribute": { + "properties": { + "resetAuthor": { + "type": "string", + "default": "a" + }, + "setAuthor": { + "type": "string", + "default": "A" + }, + "addCoAuthor": { + "type": "string", + "default": "c" + } }, - "showOutput": { - "type": "boolean", - "description": "If true, show the command's output in a popup within Lazygit" + "additionalProperties": false, + "type": "object" + }, + "stash": { + "properties": { + "popStash": { + "type": "string", + "default": "g" + }, + "renameStash": { + "type": "string", + "default": "r" + } }, - "after": { - "properties": { - "checkForConflicts": { - "type": "boolean" - } + "additionalProperties": false, + "type": "object" + }, + "commitFiles": { + "properties": { + "checkoutCommitFile": { + "type": "string", + "default": "c" + } + }, + "additionalProperties": false, + "type": "object" + }, + "main": { + "properties": { + "toggleSelectHunk": { + "type": "string", + "default": "a" }, - "additionalProperties": false, - "type": "object", - "description": "Actions to take after the command has completed" - } + "pickBothHunks": { + "type": "string", + "default": "b" + }, + "editSelectHunk": { + "type": "string", + "default": "E" + } + }, + "additionalProperties": false, + "type": "object" }, - "additionalProperties": false, - "type": "object" - }, - "type": "array", - "uniqueItems": true, - "description": "User-configured commands that can be invoked from within Lazygit" - }, - "services": { - "additionalProperties": { - "type": "string" + "submodules": { + "properties": { + "init": { + "type": "string", + "default": "i" + }, + "update": { + "type": "string", + "default": "u" + }, + "bulkMenu": { + "type": "string", + "default": "b" + } + }, + "additionalProperties": false, + "type": "object" + }, + "commitMessage": { + "properties": { + "commitMenu": { + "type": "string", + "default": "\u003cc-o\u003e" + } + }, + "additionalProperties": false, + "type": "object" + } }, + "additionalProperties": false, "type": "object", - "description": "See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-pull-request-urls" - }, - "notARepository": { - "type": "string", - "enum": [ - "prompt", - "create", - "skip", - "quit" - ], - "description": "What to do when opening Lazygit outside of a git repo.\n- 'prompt': (default) ask whether to initialize a new repo or open in the most recent repo\n- 'create': initialize a new repo\n- 'skip': open most recent repo\n- 'quit': exit Lazygit", - "default": "prompt" - }, - "promptToReturnFromSubprocess": { - "type": "boolean", - "description": "If true, display a confirmation when subprocess terminates. This allows you to view the output of the subprocess before returning to Lazygit.", - "default": true + "description": "Keybindings" } }, "additionalProperties": false,