From 4d19b1b8a970f116e23ab45ae1fcdec1a16e148a Mon Sep 17 00:00:00 2001 From: samedamci Date: Wed, 1 Sep 2021 00:16:58 +0200 Subject: [PATCH] Add colorized output to files command --- guzzy/commands/files.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guzzy/commands/files.sh b/guzzy/commands/files.sh index 9cbc5f3..727d60b 100755 --- a/guzzy/commands/files.sh +++ b/guzzy/commands/files.sh @@ -2,10 +2,11 @@ [ "$1" ] && commit_hash="$1" || commit_hash="HEAD" -commit="git --no-pager show -q $commit_hash" -limiter="seq -s_ 150|tr -d '[:digit:]'" +commit="git --no-pager log --color=always -n 1 $commit_hash" +delimiter="seq -s_ 150 | tr -d '[:digit:]'" file_content="git show $commit_hash:{}" +pager="bat --style numbers --decorations always --file-name {}" git ls-tree -r --name-only "$commit_hash" | - fzf --ansi --preview "$commit && $limiter && $file_content" \ + fzf --ansi --preview "$commit && $delimiter && $file_content | $pager" \ --preview-window=right:70%