From 6ea07273e7d8b190e3fa8eb29634da89ecde3051 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Tue, 23 May 2023 16:06:03 +0100 Subject: Add deadgrep-all function --- .emacs.d/lisp/init-search.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.emacs.d/lisp/init-search.el b/.emacs.d/lisp/init-search.el index 9d4e487..fba07e1 100644 --- a/.emacs.d/lisp/init-search.el +++ b/.emacs.d/lisp/init-search.el @@ -62,12 +62,23 @@ (defun deadgrep-current-directory (search-term) (interactive (list (deadgrep--read-search-term))) (deadgrep search-term (file-name-directory buffer-file-name))) + (defvar include-all nil) + (defun deadgrep--include-all-advice (rg-args) + (when include-all + (push "-uuuLz" rg-args))) + (advice-add 'deadgrep--arguments :filter-return #'deadgrep--include-all-advice) + (defun deadgrep-all (search-term) + (interactive (list (deadgrep--read-search-term))) + (let ((include-all t)) + (deadgrep search-term))) :bind ("C-c c d" . deadgrep) + ("C-c c M-d" . deadgrep-all) ("C-S-z" . deadgrep-symbol-at-point) ("C-c c C-d" . deadgrep-current-directory) (:map search-map ("d" . deadgrep) + ("M-d" . deadgrep-all) ("C-d" . deadgrep-current-directory) ("D" . deadgrep-symbol-at-point))) -- cgit 1.4.1-2-gfad0