From ca2a625e378f2946da39917280bb05d6f5f8224f Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Tue, 15 Jun 2021 22:29:24 +0200 Subject: git: Grep with rg when available --- lisp/init-git.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lisp/init-git.el') 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 -e -- ")) :bind (;; C-c g runs git grep in current vc tree ("C-c g" . mpolden/vc-git-grep))) -- cgit v1.2.3