summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2021-02-12 09:39:05 -0800
committerFranck Cuny <franck@fcuny.net>2021-02-12 09:39:22 -0800
commit17bb229122768fa1fc601aaabca26909173f859e (patch)
tree3b64d6d2943f68b18e9a45d6c64b9edaa4a8f29d /emacs
parentemacs: slight changes to theme settings (diff)
downloademacs.d-17bb229122768fa1fc601aaabca26909173f859e.tar.gz
emacs: new defined search for rg
Diffstat (limited to 'emacs')
-rw-r--r--emacs/custom/fcuny-navigation.el23
1 files changed, 23 insertions, 0 deletions
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)