From 17bb229122768fa1fc601aaabca26909173f859e Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 12 Feb 2021 09:39:05 -0800 Subject: emacs: new defined search for rg --- emacs/custom/fcuny-navigation.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'emacs/custom') diff --git a/emacs/custom/fcuny-navigation.el b/emacs/custom/fcuny-navigation.el index 49309a5..42027fd 100644 --- a/emacs/custom/fcuny-navigation.el +++ b/emacs/custom/fcuny-navigation.el @@ -70,6 +70,29 @@ (use-package rg :ensure t + :config + (rg-define-search fcuny/grep-git-or-dir + :query ask + :format regexp + :files "everything" + :confirm prefix + :flags ("--hidden -g !.git") + :dir (let ((vc (magit-toplevel))) + (if vc + vc + default-directory))) + (rg-define-search fcuny/grep-git-or-dir-todos + :query "TODO\|FIXME\|XXX" + :format regexp + :files "everything" + :confirm prefix + :flags ("--hidden -g !.git") + :dir (let ((vc (magit-toplevel))) + (if vc + vc + default-directory))) + :bind (("M-s g" . fcuny/grep-git-or-dir) + ("M-s t" . fcuny/grep-git-or-dir-todos)) :custom (rg-group-result t) (rg-show-columns t) -- cgit 1.4.1