From fcc0a92123fec71f7b37d00e9d469ab984d846a2 Mon Sep 17 00:00:00 2001 From: Andrea Mistrali Date: Wed, 20 Oct 2021 08:31:55 +0200 Subject: [PATCH] Added gitid and better handling of lesspipe --- zsh.d/30-less.zsh | 12 +++++++----- zsh.d/zshfunctions/gitid | 3 +++ zsh.d/zshfunctions/gitid.zwc | Bin 0 -> 704 bytes 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 zsh.d/zshfunctions/gitid create mode 100644 zsh.d/zshfunctions/gitid.zwc diff --git a/zsh.d/30-less.zsh b/zsh.d/30-less.zsh index 01504f3..b4a9d13 100644 --- a/zsh.d/30-less.zsh +++ b/zsh.d/30-less.zsh @@ -18,11 +18,13 @@ PAGER=/usr/bin/less export LESS export PAGER -LESSOPEN_SCRIPT=$(whence lesspipe lesspipe.sh) -LESSOPEN="|${LESSOPEN_SCRIPT} %s" -LESS_ADVANCED_PREPROCESSOR=1 +local LESSOPEN_SCRIPT=$(whence lesspipe lesspipe.sh) +if [ $LESSOPEN_SCRIPT ]; then + LESSOPEN="|${LESSOPEN_SCRIPT} %s" + LESS_ADVANCED_PREPROCESSOR=1 -export LESSOPEN -export LESS_ADVANCED_PREPROCESSOR + export LESSOPEN + export LESS_ADVANCED_PREPROCESSOR +fi # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/zshfunctions/gitid b/zsh.d/zshfunctions/gitid new file mode 100644 index 0000000..76ff4cf --- /dev/null +++ b/zsh.d/zshfunctions/gitid @@ -0,0 +1,3 @@ +local _temp_gitid=$(git rev-parse HEAD|cut -c1-8) +echo $_temp_gitid +which pbcopy > /dev/null && echo $_temp_gitid|tr -d '\n'|pbcopy diff --git a/zsh.d/zshfunctions/gitid.zwc b/zsh.d/zshfunctions/gitid.zwc new file mode 100644 index 0000000000000000000000000000000000000000..eeeb22935ae0b0770a1e747ddfc6fd75a70d9e60 GIT binary patch literal 704 zcmcgp%}T>S7@SS|tWFod70QJ&WTJ@2VS^8BVLI&;SHcouSr9RXYslGh^EfkBMgq&VU_-eH|AM5dE=Vc zE=}yZCN|{ct^;!7l@(327h#zCaWc$jUOch3rvBVYyy>mq8k{=rgPx@=OCMYIGkhIP zu=wn_3qlT-IjX&he5gD0oBdQ13^r=qKFCtcP!Q~N~%Pq|Aj@*WjyBM)} H|3BY%hHGxA literal 0 HcmV?d00001