plugin/man: simplify

Don't overwrite variables that the user has already set.

plugins/man: unbound `$LESS`
pull/2009/head
John D Pell 2021-10-09 10:16:02 -07:00
parent 290aab4efe
commit dc5c9e107c
1 changed files with 9 additions and 7 deletions

View File

@ -1,12 +1,14 @@
# shellcheck shell=bash # shellcheck shell=bash
about-plugin 'colorize man pages for better readability' about-plugin 'colorize man pages for better readability'
export LESS_TERMCAP_mb=$'\e[1;32m' : "${LESS_TERMCAP_mb:=$'\e[1;32m'}"
export LESS_TERMCAP_md=$'\e[1;32m' : "${LESS_TERMCAP_md:=$'\e[1;32m'}"
export LESS_TERMCAP_me=$'\e[0m' : "${LESS_TERMCAP_me:=$'\e[0m'}"
export LESS_TERMCAP_se=$'\e[0m' : "${LESS_TERMCAP_se:=$'\e[0m'}"
export LESS_TERMCAP_so=$'\e[01;33m' : "${LESS_TERMCAP_so:=$'\e[01;33m'}"
export LESS_TERMCAP_ue=$'\e[0m' : "${LESS_TERMCAP_ue:=$'\e[0m'}"
export LESS_TERMCAP_us=$'\e[1;4;31m' : "${LESS_TERMCAP_us:=$'\e[1;4;31m'}"
: "${LESS:=}"
export "${!LESS_TERMCAP@}"
export LESS="R${LESS#-}" export LESS="R${LESS#-}"