From fec46051f038d2f00ca8cf86bb3fbd2322f70a77 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 13 Dec 2012 20:15:16 -0600 Subject: [PATCH] .bashrc: Use grep --color=always and setup GREP_COLORS Always use colorized grep and setup custom grep colors. --- .bashrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 5764c0c..5958d8d 100644 --- a/.bashrc +++ b/.bashrc @@ -305,12 +305,16 @@ if [ -n "$COLORS" ]; then case "$UNAME" in "SunOS") # For Solaris, use the GNU version of grep for color support - test -x /usr/gnu/bin/grep && alias grep="/usr/gnu/bin/grep --color=auto" + test -x /usr/gnu/bin/grep && alias grep="/usr/gnu/bin/grep --color=always" ;; *) - alias grep="command grep --color=auto" + alias grep="command grep --color=always" ;; esac + # older versions of grep only support a singular highlight color + export GREP_COLOR='1;37;42' + # newer versions of grep have more flexible color configuration + export GREP_COLORS='fn=36:ln=1;33:ms=1;37;42' fi # -------------------------------------------------------------------- -- 2.43.0