-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Custom Commands Compendium
Jesse Duffield edited this page Nov 21, 2020
·
48 revisions
If you have implemented a custom command(s) that you find useful, please add it here so others can find it too. If a particular command proves popular, we will merge it into the codebase for all to use.
If you want to know how to implement your own custom commands see here
Creating a review in Gerrit
customCommands:
- key: '<c-p>'
command: "git push origin HEAD:refs/for/{{.CheckedOutBranch.Name}}"
context: 'global'
loadingText: 'pushing'
customCommands:
- key: '<c-p>'
context: 'global'
loadingText: 'pushing'
prompts:
- type: 'input'
title: 'which branch do you want to push to?'
command: "git push origin {{index .PromptResponses 0}}"
- key : 'N'
description: 'create annotated tag'
command: "git tag -a {{index .PromptResponses 0}} -m \"{{index .PromptResponses 1}}\""
context: 'tags'
prompts:
- type: 'input'
title: 'Annotated tag name:'
- type: 'input'
title: 'Annotated tag message:'
customCommands:
- key: "<c-r>"
command: "gh pr create --fill --web"
context: "global"
loadingText: "Creating pull request on GitHub"
This can be customized to fit your needs. Run gh pr create --help
to see what flags are available.
customCommands:
- key: "v" # couldn't think of a better keybinding
prompts:
- type: 'input'
title: 'PR id:'
command: "hub pr checkout {{index .PromptResponses 0}}"
context: "localBranches"
loadingText: "checking out PR"
- key: "M"
command: "git mergetool {{ .SelectedFile.Name }}"
context: "files"
loadingText: "opening git mergetool"
subprocess: true