Skip to content

Commit 6fcc91a

Browse files
committed
plugin/man: simplify
Don't overwrite variables that the user has already set.
1 parent 05127cf commit 6fcc91a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

plugins/available/man.plugin.bash

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
cite about-plugin
22
about-plugin 'colorize man pages for better readability'
33

4-
export LESS_TERMCAP_mb=$'\e[1;32m'
5-
export LESS_TERMCAP_md=$'\e[1;32m'
6-
export LESS_TERMCAP_me=$'\e[0m'
7-
export LESS_TERMCAP_se=$'\e[0m'
8-
export LESS_TERMCAP_so=$'\e[01;33m'
9-
export LESS_TERMCAP_ue=$'\e[0m'
10-
export LESS_TERMCAP_us=$'\e[1;4;31m'
4+
: "${LESS_TERMCAP_mb:=$'\e[1;32m'}"
5+
: "${LESS_TERMCAP_md:=$'\e[1;32m'}"
6+
: "${LESS_TERMCAP_me:=$'\e[0m'}"
7+
: "${LESS_TERMCAP_se:=$'\e[0m'}"
8+
: "${LESS_TERMCAP_so:=$'\e[01;33m'}"
9+
: "${LESS_TERMCAP_ue:=$'\e[0m'}"
10+
: "${LESS_TERMCAP_us:=$'\e[1;4;31m'}"
11+
12+
export "${!LESS_TERMCAP@}"
1113

1214
export LESS="R${LESS#-}"

0 commit comments

Comments
 (0)