]> Sergey Matveev's repositories - dotfiles.git/commitdiff
zshify grep variables
authorSergey Matveev <stargrave@stargrave.org>
Wed, 2 Jun 2021 08:37:45 +0000 (11:37 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 2 Jun 2021 08:37:45 +0000 (11:37 +0300)
zsh/.zshrc

index 0a18bb0288764271526a46dede629a7c5165c7a0..7351026a8f65531e6052a7d0f3d82b636cf7ec70 100644 (file)
@@ -132,16 +132,20 @@ bindkey -s "\eOR" " 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 "
 # }}}