1
0
Fork 0

Zsh: Use lesspipe.sh for LESSOPEN and lessp if it exists.

This commit is contained in:
tastytea 2022-03-21 12:04:25 +01:00
parent 14ce8345e6
commit 5ad37b1396
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 5 additions and 1 deletions

View File

@ -86,6 +86,8 @@ if command -v highlight > /dev/null; then
LESSOPEN="| $(command -v highlight) --force --out-format=truecolor --style=base16/unikitty-reversible --stdout %s"
elif command -v src-hilite-lesspipe.sh > /dev/null; then
LESSOPEN="| $(command -v src-hilite-lesspipe.sh) %s"
elif command -v lesspipe.sh > /dev/null; then
LESSOPEN="| lesspipe.sh %s"
elif command -v lesspipe > /dev/null; then
LESSOPEN="| lesspipe %s"
fi

View File

@ -65,7 +65,9 @@ alias cmake_static='cmake -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" -DBUILD_SHARED_LIBS
alias crontab='crontab -i'
# Explicitly use lesspipe.
if command -v lesspipe > /dev/null; then
if command -v lesspipe.sh > /dev/null; then
alias lessp='LESSOPEN="|lesspipe.sh %s" less'
elif command -v lesspipe > /dev/null; then
alias lessp='LESSOPEN="|lesspipe %s" less'
fi
# Follow mode does not work with highlight.