about summary refs log tree commit diff
path: root/users/tazjin/emacs/config/functions.el
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/emacs/config/functions.el')
-rw-r--r--users/tazjin/emacs/config/functions.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/users/tazjin/emacs/config/functions.el b/users/tazjin/emacs/config/functions.el
index 74c737ad71..5963d142c1 100644
--- a/users/tazjin/emacs/config/functions.el
+++ b/users/tazjin/emacs/config/functions.el
@@ -317,4 +317,12 @@ the GPG agent correctly."
     (url-retrieve "https://songwhip.com/api/" #'songwhip--handle-result nil t t)
     (message "Requesting Songwhip URL ... please hold the line.")))
 
+(defun rg-in-project (&optional prefix)
+  "Interactively call ripgrep in the current project, or fall
+  back to ripgrep default behaviour if prefix is set."
+  (interactive "P")
+  (counsel-rg nil (unless prefix
+                    (if-let ((pr (project-current)))
+                        (project-root pr)))))
+
 (provide 'functions)