From c009782f6bce3f12a626b8de92742a958f60174c Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 2 Jun 2021 11:37:45 +0300 Subject: [PATCH] zshify grep variables --- zsh/.zshrc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 " # }}} -- 2.44.0