summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorElwardi <elwardifadeli@gmail.com>2021-08-07 16:06:36 +0100
committerElwardi <elwardifadeli@gmail.com>2021-08-07 16:06:36 +0100
commitb5d8849c06de3d0ea410e0ba03e66b101b1ec626 (patch)
tree07671c4286286cae63621d92e801ffbbdd213ac1 /docs
parent5d1a9639b6dc7f2a5267cb2f919f96a6f7bd95d1 (diff)
Support match colors in `labelFormat` entry in menuFromCommand prompts
Diffstat (limited to 'docs')
-rw-r--r--docs/Custom_Command_Keybindings.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/Custom_Command_Keybindings.md b/docs/Custom_Command_Keybindings.md
index c48442362..8b0c769c2 100644
--- a/docs/Custom_Command_Keybindings.md
+++ b/docs/Custom_Command_Keybindings.md
@@ -48,7 +48,7 @@ customCommands:
command: 'git branch -r --list {{index .PromptResponses 0}}/*'
filter: '.*{{index .PromptResponses 0}}/(?P<branch>.*)'
valueFormat: '{{ .branch }}'
- labelFormat: ''
+ labelFormat: '{{ .branch | green }}'
```
Looking at the command assigned to the 'n' key, here's what the result looks like:
@@ -110,8 +110,10 @@ The permitted prompt fields are:
| | PS: named groups keep first match only | |
| labelFormat | (only applicable to 'menuFromCommand' prompts) how to format matched groups from | no |
| | the filter to construct the item's label (What's shown on screen). You can use | |
-| | named groups, or `{{ .group_GROUPID }}`. If this is not specified, `valueFormat` | |
-| | is shown instead. | |
+| | named groups, or `{{ .group_GROUPID }}`. You can also color each match with | |
+| | `{{ .group_GROUPID | colorname }}` (Color names from | |
+| | [here](https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md)) | |
+| | If `labelFormat` is not specified, `valueFormat` is shown instead. | |
| | PS: named groups keep first match only | |
The permitted option fields are: