Browse Source

utility: Honor pre-defined COLOR settings for grep

Honor `GREP_COLOR` or `GREP_COLORS` if already defined for coloring
`grep` output.
master
Indrajit Raychaudhuri 4 years ago committed by Indrajit Raychaudhuri
parent
commit
8ecf87bd7c
  1. 4
      modules/utility/init.zsh

4
modules/utility/init.zsh

@ -130,8 +130,8 @@ fi @@ -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

Loading…
Cancel
Save