mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Update menuFromCommand configuration
parent
5446cf3c06
commit
a613d908c0
1 changed files with 6 additions and 4 deletions
|
@ -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`
|
Loading…
Add table
Add a link
Reference in a new issue