]> Sergey Matveev's repositories - dotfiles.git/blobdiff - zsh/.zshrc
wc -l is really used often
[dotfiles.git] / zsh / .zshrc
index adc241e438f48e0c39cdec09f19a348a6ce6bd76..32125143c1d8dfbca070aeb00a340949d313831a 100644 (file)
@@ -96,6 +96,7 @@ alias Gd="git diff"
 alias Gs="git show"
 alias Gm="git diff --name-only --diff-filter=M"
 alias Gam="git commit --amend"
+alias -g W="| wc -l"
 
 git_common="--oneline --abbrev-commit"
 alias Gl="git log $git_common --graph --decorate=short"
@@ -109,10 +110,13 @@ bindkey -s "\eOR" " git status --short\n" # F3
 
 # grep {{{
 GREP=/usr/local/bin/grep
+GREP_ARGS="--color=always --with-filename --line-number --recursive"
+LESS_COLORED="less --RAW-CONTROL-CHARS"
 g() {
-    $GREP --color=always --with-filename --line-number --recursive $@ |
-        sort --numeric-sort |
-        less --RAW-CONTROL-CHARS
+    $GREP ${=GREP_ARGS} $@ | ${=LESS_COLORED}
+}
+gS() {
+    $GREP ${=GREP_ARGS} $@ | sort --numeric-sort | ${=LESS_COLORED}
 }
 alias -g G="| $GREP --color"
 alias gg="git grep "