summaryrefslogtreecommitdiffstats
path: root/lisp/init-git.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/init-git.el')
-rw-r--r--lisp/init-git.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index b598dc5..b4245af 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -64,6 +64,14 @@ If NOSELECT is non-nil, do not select the window."
(use-package vc-git
:commands vc-git-grep
+ :init
+ (when (executable-find "rg")
+ ;; use ripgrep
+ ;; -n show line numbers
+ ;; -H show filename
+ ;; --no-heading don't group matches
+ ;; -e the regexp
+ (setq vc-git-grep-template "rg -nH --no-heading <C> -e <R> -- <F>"))
:bind (;; C-c g runs git grep in current vc tree
("C-c g" . mpolden/vc-git-grep)))