From 8ecf87bd7c97d7222abc2dac2934e3fa78fe30f8 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 8 May 2021 21:26:03 -0500 Subject: [PATCH] utility: Honor pre-defined COLOR settings for grep Honor `GREP_COLOR` or `GREP_COLORS` if already defined for coloring `grep` output. --- modules/utility/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 1daf8a5..a06eff8 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -130,8 +130,8 @@ fi # Grep if zstyle -t ':prezto:module:utility:grep' color; then - export GREP_COLOR='37;45' # BSD. - export GREP_COLORS="mt=$GREP_COLOR" # GNU. + export GREP_COLOR=${GREP_COLOR:-'37;45'} # BSD. + export GREP_COLORS=${GREP_COLORS:-"mt=$GREP_COLOR"} # GNU. alias grep="${aliases[grep]:-grep} --color=auto" fi