diff --git a/README.org b/README.org index b40f129..88960b7 100644 --- a/README.org +++ b/README.org @@ -1347,6 +1347,45 @@ to {{{kbd(M-s d)}}} and =deadgrep-edit-mode= to {{{kbd(C-c C-w)}}}. (define-key deadgrep-mode-map (kbd "C-c C-w") #'deadgrep-edit-mode))) #+end_src +** [[https://www.genivia.com/get-ugrep.html][Ugrep]] +:PROPERTIES: +:CUSTOM_ID: sec:ugrep +:END: + +[[https://www.genivia.com/get-ugrep.html][Ugrep]] is an ultra fast grep with interactive query UI and fuzzy search. The +pages [[https://github.com/Genivia/ugrep#emacs][Using ugrep within Emacs]] and [[https://manueluberti.eu/emacs/2022/08/07/emacs-ugrep/][Ugrep in Emacs]] show how to make Emacs use it +with [[info:emacs#Grep Searching][lgrep]] and [[info:emacs#Xref][xref]]. Listing [[lst:use-ugrep]] shows my implementation of the +suggestions in those pages. + +#+caption[Use =ugrep= when available]: +#+caption: Use =ugrep= when available. +#+name: lst:use-ugrep +#+begin_src emacs-lisp + (when (executable-find "ugrep") + (with-eval-after-load 'grep + (custom-set-variables + `(grep-template ,(string-join '("ugrep" + "--color=always" + "--ignore-binary" + "--ignore-case" + "--include=\"\"" + "--line-number" + "--null" + "--recursive" + "--regexp=") + " ")))) + (with-eval-after-load 'xref + (custom-set-variables + '(xref-search-program-alist + '((grep + . "xargs -0 grep --null -snHE -e ") + (ripgrep + . "xargs -0 rg --null -nH --no-heading --no-messages -g '!*/' -e ") + (ugrep + . "xargs -0 ugrep --null -ns -e "))) + '(xref-search-program 'ugrep)))) +#+end_src + * [[info:emacs#Version Control][Version Control (info)]] :PROPERTIES: :CUSTOM_ID: sec:version-control