summaryrefslogtreecommitdiffstats
path: root/docs/Custom_Command_Keybindings.md
diff options
context:
space:
mode:
authorElwardi <elwardifadeli@gmail.com>2021-07-17 19:18:41 +0100
committerElwardi <elwardifadeli@gmail.com>2021-07-18 10:36:01 +0100
commit9daa47fb2df8b58a3edc82ed48687205c2bd85e9 (patch)
treed5f924faa9b27d7a809583b3df257da5a6de820c /docs/Custom_Command_Keybindings.md
parentd18c8c8dc39fa028949470064dc9a596762f7f09 (diff)
Add docs for menuFromCommand prompts
Diffstat (limited to 'docs/Custom_Command_Keybindings.md')
-rw-r--r--docs/Custom_Command_Keybindings.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/Custom_Command_Keybindings.md b/docs/Custom_Command_Keybindings.md
index 5a63e2241..7a9f1bc0d 100644
--- a/docs/Custom_Command_Keybindings.md
+++ b/docs/Custom_Command_Keybindings.md
@@ -35,6 +35,18 @@ customCommands:
command: "git flow {{index .PromptResponses 0}} start {{index .PromptResponses 1}}"
context: 'localBranches'
loadingText: 'creating branch'
+ - key : 'r'
+ description: 'Checkout a remote branch as FETCH_HEAD'
+ command: "git fetch {{index .PromptResponses 0}} {{index .PromptResponses 1}} && git checkout FETCH_HEAD"
+ context: 'remotes'
+ prompts:
+ - type: 'input'
+ title: 'Remote:'
+ initialValue: "{{index .SelectedRemote.Name }}"
+ - type: 'menuFromCommand'
+ title: 'Remote branch:'
+ command: 'git branch -r --list {{index .PromptResponses 0}}/*'
+ filter: '.*{{index .PromptResponses 0}}/(.*)'
```
Looking at the command assigned to the 'n' key, here's what the result looks like:
@@ -85,6 +97,10 @@ The permitted prompt fields are:
| 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 specify groups | yes |
+| | which are going to be kept from the command's output | |
The permitted option fields are:
| _field_ | _description_ | _required_ |