From: Sergey Matveev Date: Wed, 2 Jun 2021 08:37:45 +0000 (+0300) Subject: zshify grep variables X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=c009782f6bce3f12a626b8de92742a958f60174c zshify grep variables --- diff --git a/zsh/.zshrc b/zsh/.zshrc index 0a18bb0..7351026 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -132,16 +132,20 @@ bindkey -s "OR" " git status --short\n" # F3 # }}} # grep {{{ -GREP=/usr/local/bin/grep -GREP_ARGS="--color=always --with-filename --line-number --dereference-recursive" -LESS_COLORED="less --RAW-CONTROL-CHARS" +GREP_ARGS=( + --color=always + --with-filename + --line-number + --dereference-recursive +) +LESS_COLORED=(less --RAW-CONTROL-CHARS) g() { - $GREP ${=GREP_ARGS} $@ | ${=LESS_COLORED} + grep $GREP_ARGS $@ | $LESS_COLORED } GS() { - $GREP ${=GREP_ARGS} $@ | sort --numeric-sort | ${=LESS_COLORED} + grep $GREP_ARGS $@ | sort --numeric-sort | $LESS_COLORED } -alias -g G="| $GREP --color" +alias -g G="| grep --color=always" alias gg="git grep " # }}}