From 31f5accaa54f6110cfeefa19e3e4ed6d1a71190b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 24 May 2024 11:06:31 +0200 Subject: less: fix hilite by using env --- shellrc.d/less | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'shellrc.d') diff --git a/shellrc.d/less b/shellrc.d/less index d2490a5..b9d4c90 100644 --- a/shellrc.d/less +++ b/shellrc.d/less @@ -1,10 +1,19 @@ # vim: ft=sh: export LESS=-R -export LESS_TERMCAP_mb=$'\E[1;31m' -export LESS_TERMCAP_md=$'\E[1;36m' -export LESS_TERMCAP_me=$'\E[0m' -export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[01;44;33m' -export LESS_TERMCAP_ue=$'\E[0m' -export LESS_TERMCAP_us=$'\E[1;32m' -[ -x /usr/bin/src-hilite-lesspipe.sh ] && export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" +export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) +export LESS_TERMCAP_md=$(tput bold; tput setaf 6) +export LESS_TERMCAP_me=$(tput sgr0) +export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) +export LESS_TERMCAP_se=$(tput rmso; tput sgr0) +export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) +export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) +export LESS_TERMCAP_mr=$(tput rev) +export LESS_TERMCAP_mh=$(tput dim) +export LESS_TERMCAP_ZN=$(tput ssubm) +export LESS_TERMCAP_ZV=$(tput rsubm) +export LESS_TERMCAP_ZO=$(tput ssupm) +export LESS_TERMCAP_ZW=$(tput rsupm) +export GROFF_NO_SGR=1 # For Konsole and Gnome-terminal +if command -v src-hilite-lesspipe.sh >/dev/null; then + export LESSOPEN="| $(command -v src-hilite-lesspipe.sh) %s" +fi -- cgit v1.2.3