From cd92e3fbc02d558ac881167af0ae474b91804d96 Mon Sep 17 00:00:00 2001
From: Sergey Matveev <stargrave@stargrave.org>
Date: Fri, 25 Jun 2021 18:37:18 +0300
Subject: [PATCH] External (GNU) grep is much faster

---
 vim/.vim/plugin/grep.vim | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/vim/.vim/plugin/grep.vim b/vim/.vim/plugin/grep.vim
index 834390a..f7a5f12 100644
--- a/vim/.vim/plugin/grep.vim
+++ b/vim/.vim/plugin/grep.vim
@@ -1,11 +1,10 @@
 if exists('*<SID>Vim') | finish | endif
 
 function! s:Vim(pattern)
-    let ignorecase_bak=&ignorecase
-    set noignorecase
-    execute "vimgrep /" . a:pattern . "/ **/*"
+    set grepprg=grep\ -Rns\ --binary-files=without-match\ --exclude-dir=.git\ --exclude-dir=.tags\ $*\ /dev/null\ .
+    execute "silent grep \"" . a:pattern . "\""
     copen
-    let &ignorecase=ignorecase_bak
+    redraw!
     let g:pylint_disable=1
 endfunction
 
-- 
2.51.0