diff options
author | Elwardi <elwardifadeli@gmail.com> | 2021-08-05 15:24:17 +0100 |
---|---|---|
committer | Elwardi <elwardifadeli@gmail.com> | 2021-08-05 15:45:18 +0100 |
commit | a8ec044f0e52bff8921592fb4d334a4d6f4c7468 (patch) | |
tree | 0f9dcdf7bb9b041c81f5c34e9fe97f5f9a92afb1 /docs/Custom_Command_Keybindings.md | |
parent | d626bcac0029267d3f45223198902f5cb78d9dc1 (diff) |
Make menuFromCommand format menu items and their description
Diffstat (limited to 'docs/Custom_Command_Keybindings.md')
-rw-r--r-- | docs/Custom_Command_Keybindings.md | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/docs/Custom_Command_Keybindings.md b/docs/Custom_Command_Keybindings.md index 9dc42a9da..c167309f8 100644 --- a/docs/Custom_Command_Keybindings.md +++ b/docs/Custom_Command_Keybindings.md @@ -47,7 +47,8 @@ customCommands: title: 'Remote branch:' command: 'git branch -r --list {{index .PromptResponses 0}}/*' filter: '.*{{index .PromptResponses 0}}/(?P<branch>.*)' - format: '{{ .branch }}' + itemFormat: '{{ .branch }}' + descriptionFormat: '' ``` Looking at the command assigned to the 'n' key, here's what the result looks like: @@ -92,19 +93,24 @@ The permitted contexts are: The permitted prompt fields are: -| _field_ | _description_ | _required_ | -| ------------ | -------------------------------------------------------------------------------- | ---------- | -| type | one of 'input' or 'menu' | yes | -| title | the title to display in the popup panel | no | -| initialValue | (only applicable to 'input' prompts) the initial value to appear in the text box | no | -| options | (only applicable to 'menu' prompts) the options to display in the menu | no | -| command | (only applicable to 'menuFromCommand' prompts) the command to run to generate | yes | -| | menu options | | -| filter | (only applicable to 'menuFromCommand' prompts) the regexp to run specifying | yes | -| | groups which are going to be kept from the command's output | | -| format | (only applicable to 'menuFromCommand' prompts) how to format matched groups from | yes | -| | the filter. You can use named groups, or `{{ .group_GROUPID }}`. | yes | -| | PS: named groups keep first match only | yes | +| _field_ | _description_ | _required_ | +| ------------ | -------------------------------------------------------------------------------- | ---------- | +| type | one of 'input' or 'menu' | yes | +| title | the title to display in the popup panel | no | +| initialValue | (only applicable to 'input' prompts) the initial value to appear in the text box | no | +| options | (only applicable to 'menu' prompts) the options to display in the menu | no | +| command | (only applicable to 'menuFromCommand' prompts) the command to run to generate | yes | +| | menu options | | +| filter | (only applicable to 'menuFromCommand' prompts) the regexp to run specifying | yes | +| | groups which are going to be kept from the command's output | | +| itemFormat | (only applicable to 'menuFromCommand' prompts) how to format matched groups from | yes | +| | the filter to construct a menu item. You can use named groups, | yes | +| | or `{{ .group_GROUPID }}`. | | +| | PS: named groups keep first match only | yes | +| descriptionFormat | (only applicable to 'menuFromCommand' prompts) how to format matched groups from | yes | +| | the filter to construct a menu item's description. You can use named groups, | yes | +| | or `{{ .group_GROUPID }}`. | | +| | PS: named groups keep first match only | yes | The permitted option fields are: | _field_ | _description_ | _required_ | |