]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Sort filenames after grep
authorSergey Matveev <stargrave@stargrave.org>
Thu, 19 Dec 2019 12:00:38 +0000 (15:00 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 19 Dec 2019 12:00:38 +0000 (15:00 +0300)
zsh/.zshrc

index 7dcc18fe8189b791185246b0d6902116be750023..be99ef3acd451f3221140daa545a31b941697967 100644 (file)
@@ -110,7 +110,9 @@ bindkey -s "\eOR" " git status --short\n" # F3
 # grep {{{
 GREP=/usr/local/bin/grep
 g() {
-    $GREP --color=always --with-filename --line-number --recursive $@ | less --RAW-CONTROL-CHARS
+    $GREP --color=always --with-filename --line-number --recursive $@ |
+        sort --numeric-sort |
+        less --RAW-CONTROL-CHARS
 }
 alias -g G="| $GREP --color"
 alias grep="$GREP"