From a65915c3bf698bdc7a8ec7d103b9de0e5f028707 Mon Sep 17 00:00:00 2001
From: Sergey Matveev <stargrave@stargrave.org>
Date: Thu, 19 Dec 2019 15:00:38 +0300
Subject: [PATCH] Sort filenames after grep

---
 zsh/.zshrc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/zsh/.zshrc b/zsh/.zshrc
index 7dcc18f..be99ef3 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -110,7 +110,9 @@ bindkey -s "OR" " 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"
-- 
2.51.0