You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Custom_Command_Keybindings.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,6 +192,7 @@ The permitted option fields are:
192
192
| name | The first part of the label | no |
193
193
| description | The second part of the label | no |
194
194
| value | the value that will be used in the command | yes |
195
+
| key | Keybinding to invoke this menu option without needing to navigate to it. Can be a single letter or one of the values from [here](https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md) | no |
195
196
196
197
If an option has no name the value will be displayed to the user in place of the name, so you're allowed to only include the value like so:
197
198
@@ -233,6 +234,34 @@ customCommands:
233
234
description: 'branch for a release'
234
235
```
235
236
237
+
Here's an example of supplying keybindings for menu options:
238
+
239
+
```yml
240
+
customCommands:
241
+
- key: 'a'
242
+
command: 'echo {{.Form.BranchType | quote}}'
243
+
context: 'commits'
244
+
prompts:
245
+
- type: 'menu'
246
+
title: 'What kind of branch is it?'
247
+
key: 'BranchType'
248
+
options:
249
+
- value: 'feature'
250
+
name: 'feature branch'
251
+
description: 'branch based off develop'
252
+
key: 'f'
253
+
- value: 'hotfix'
254
+
name: 'hotfix branch'
255
+
description: 'branch based off main for fast bug fixes'
256
+
key: 'h'
257
+
- value: 'release'
258
+
name: 'release branch'
259
+
description: 'branch for a release'
260
+
key: 'r'
261
+
```
262
+
263
+
In this example, pressing 'f', 'h', or 'r' will directly select the corresponding option without needing to navigate to it first.
|`` P ``| 推送 | 推送当前分支到它的上游。如果上游未配置,您可以在弹窗中配置上游分支。 |
16
16
|`` p ``| 拉取 | 从当前分支的远程分支获取改动。如果上游未配置,您可以在弹窗中配置上游分支。 |
17
-
|`` ) ``| 提高重命名相似度阈值 |Increase the similarity threshold for a deletion and addition pair to be treated as a rename.<br><br>The default can be changed in the config file with the key 'git.renameSimilarityThreshold'.|
18
-
|`` ( ``| 降低重命名相似度阈值 |Decrease the similarity threshold for a deletion and addition pair to be treated as a rename.<br><br>The default can be changed in the config file with the key 'git.renameSimilarityThreshold'.|
19
-
|`` } ``| 扩大差异视图中显示的上下文范围 |Increase the amount of the context shown around changes in the diff view.<br><br>The default can be changed in the config file with the key 'git.diffContextSize'.|
20
-
|`` { ``| 缩小差异视图中显示的上下文范围 |Decrease the amount of the context shown around changes in the diff view.<br><br>The default can be changed in the config file with the key 'git.diffContextSize'.|
|`` <c-w> ``| 切换是否在差异视图中显示空白字符差异 |Toggle whether or not whitespace changes are shown in the diff view.<br><br>The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'.|
|`` y ``| 复制提交属性到剪贴板 | 复制提交属性到剪贴板(如hash、URL、diff、消息、作者)。 |
70
-
|`` o ``| 在浏览器中打开提交 ||
71
-
|`` n ``| 从提交创建新分支 ||
72
-
|`` N ``| 移动提交至新分支 | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
73
-
|`` g ``| 查看重置选项 | 查看重置选项 (soft/mixed/hard) 用于重置到选择项 |
|`` y ``| 复制提交属性到剪贴板 | 复制提交属性到剪贴板(如hash、URL、diff、消息、作者)。 |
90
63
|`` o ``| 在浏览器中打开提交 ||
91
64
|`` n ``| 从提交创建新分支 ||
92
-
|`` N ``| 移动提交至新分支 |Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which).|
65
+
|`` N ``| 移动提交至新分支 |创建一个新分支,并将当前分支未推送的提交移动到该分支。如果您打算开始新工作但忘记先创建新分支,这会很有用。<br><br>请注意,此操作忽略选择,新分支总是从主分支创建或堆叠在当前分支之上(您可以选择哪种方式)。|
93
66
|`` g ``| 查看重置选项 | 查看重置选项 (soft/mixed/hard) 用于重置到选择项 |
|`` y ``| 复制提交属性到剪贴板 | 复制提交属性到剪贴板(如hash、URL、diff、消息、作者)。 |
155
148
|`` o ``| 在浏览器中打开提交 ||
156
149
|`` n ``| 从提交创建新分支 ||
157
-
|`` N ``| 移动提交至新分支 |Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which).|
150
+
|`` N ``| 移动提交至新分支 |创建一个新分支,并将当前分支未推送的提交移动到该分支。如果您打算开始新工作但忘记先创建新分支,这会很有用。<br><br>请注意,此操作忽略选择,新分支总是从主分支创建或堆叠在当前分支之上(您可以选择哪种方式)。|
158
151
|`` g ``| 查看重置选项 | 查看重置选项 (soft/mixed/hard) 用于重置到选择项 |
|`` N ``| 移动提交至新分支 |Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which).|
228
+
|`` N ``| 移动提交至新分支 |创建一个新分支,并将当前分支未推送的提交移动到该分支。如果您打算开始新工作但忘记先创建新分支,这会很有用。<br><br>请注意,此操作忽略选择,新分支总是从主分支创建或堆叠在当前分支之上(您可以选择哪种方式)。|
0 commit comments