From 31240748dd36855ccaead96d22caf27ede0710f7 Mon Sep 17 00:00:00 2001 From: chenyc Date: Mon, 9 Oct 2023 11:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E7=9F=A5=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88=E5=B0=9D=E8=AF=95=E4=BD=BF?= =?UTF-8?q?=E7=94=A8cat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/git.zsh | 1 + lib/file_preview.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/config/git.zsh b/config/git.zsh index a720339..d305e37 100644 --- a/config/git.zsh +++ b/config/git.zsh @@ -12,6 +12,7 @@ alias gpl='git pull origin $(git symbolic-ref --short -q HEAD) --ff-only' alias gd='git --no-pager diff' alias gs='git --no-pager status' alias gss='git --no-pager status -s' +alias gsh='git --no-pager show' alias gpt='git push origin --tags' alias glt='git tag -n --sort=taggerdate | tail -n ${1-10}' gat() { git tag -a $1 -m "$2" } diff --git a/lib/file_preview.sh b/lib/file_preview.sh index 96f10b0..efd50f2 100755 --- a/lib/file_preview.sh +++ b/lib/file_preview.sh @@ -9,4 +9,5 @@ elif [ "$category" = image ]; then command -v ueberzug 2&>/dev/null && bash $OMZ/lib/img_preview.sh "$1"|| img2txt "$1" else echo $1 is a $category file + (bat -p --color=always "$1" || cat "$1") 2>/dev/null | head -1000 fi