Zsh: Add pygmentize and source-highlight as LESSOPEN candidates
Remove src-hilite-lesspipe.sh, it is a wrapper around source-highlight.
This commit is contained in:
parent
da67f29c6e
commit
f4f8db2359
@ -84,12 +84,14 @@ export LESS="--tabs=4 --RAW-CONTROL-CHARS --LONG-PROMPT"
|
||||
|
||||
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 pygmentize > /dev/null; then
|
||||
LESSOPEN="| $(command -v pygmentize) -f terminal16m -g -O style=paraiso-dark %s"
|
||||
elif command -v source-highlight > /dev/null; then
|
||||
LESSOPEN="| $(command -v source-highlight) --failsafe --infer-lang --out-format=esc --style-file=esc.style --input=%s"
|
||||
elif command -v lesspipe > /dev/null; then
|
||||
LESSOPEN="| lesspipe %s"
|
||||
LESSOPEN="| $(command -v lesspipe) %s"
|
||||
elif command -v lesspipe.sh > /dev/null; then
|
||||
LESSOPEN="| $(command -v lesspipe.sh) %s"
|
||||
fi
|
||||
export LESSOPEN
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
if [[ -t 1 ]] && [[ -n "${CATOPEN}" || -n "${LESSOPEN}" ]]; then
|
||||
if [[ -z "${CATOPEN}" ]]; then
|
||||
# Programs that won't work with cat
|
||||
local -a known_bad=("lesspipe")
|
||||
local -a known_bad=("lesspipe" "pygmentize" "source-highlight")
|
||||
for baddy in ${known_bad}; do
|
||||
if [[ "${LESSOPEN}" =~ "${baddy}" ]]; then
|
||||
\cat "${@}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user