Update menuFromCommand configuration

Mohammed Elwardi Fadeli 2021-08-17 23:23:33 +01:00
parent 5446cf3c06
commit a613d908c0

@ -102,7 +102,7 @@ customCommands:
```yml
customCommands:
- key : '<c-a>' # Out of sane keybindings in commits context :(
- key : '<c-a>'
description: 'Search the whole history (From a ref and down) for an expression in a file'
command: "git checkout {{index .PromptResponses 3}}"
context: 'commits'
@ -117,10 +117,12 @@ customCommands:
- type: 'menuFromCommand'
title: 'Commits:'
command: "git log --oneline {{index .PromptResponses 2}} -S'{{index .PromptResponses 0}}' --all -- {{index .PromptResponses 1}}"
filter: '(?P<commit_id>[0-9a-zA-Z]+) .*' # or just '(?P<commit_id>.*)' to catch commit descriptions too
format: '{{ .commit_id }}'
filter: '(?P<commit_id>[0-9a-zA-Z]*) *(?P<commit_msg>.*)'
valueFormat: '{{ .commit_id }}'
labelFormat: '{{ .commit_id | green | bold }} - {{ .commit_msg | yellow }}'
```
Example Usage on lazygit repo:
- Search word: `lazygit`
- Subtree/File: `**/commits.go`
- Ref: `master`
- Ref: `master`
Note also that color functions are supported in `labelFormat`