From a613d908c041d56ec99fd67ae109f842b29a4d12 Mon Sep 17 00:00:00 2001 From: Mohammed Elwardi Fadeli <34474472+FoamScience@users.noreply.github.com> Date: Tue, 17 Aug 2021 23:23:33 +0100 Subject: [PATCH] Update menuFromCommand configuration --- Custom-Commands-Compendium.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Custom-Commands-Compendium.md b/Custom-Commands-Compendium.md index c35a94d..c802b5b 100644 --- a/Custom-Commands-Compendium.md +++ b/Custom-Commands-Compendium.md @@ -102,7 +102,7 @@ customCommands: ```yml customCommands: - - key : '' # Out of sane keybindings in commits context :( + - key : '' 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[0-9a-zA-Z]+) .*' # or just '(?P.*)' to catch commit descriptions too - format: '{{ .commit_id }}' + filter: '(?P[0-9a-zA-Z]*) *(?P.*)' + 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` \ No newline at end of file + - Ref: `master` +Note also that color functions are supported in `labelFormat` \ No newline at end of file