mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-15 13:23:42 -05:00
Add +(helm|ivy)-project-search-engines variables
This allows you to control what search engines for project-search commands (bound to SPC / p) to try, and in what order. If you didn't want to use ripgrep, for instance, remove 'rg from these variables, or move it to the end of the list.
This commit is contained in:
@@ -33,9 +33,9 @@ order.
|
||||
(helm-ag--default-directory directory)
|
||||
(helm-ag--default-target (list directory))
|
||||
(engine (or engine
|
||||
(and (executable-find "rg") 'rg)
|
||||
(and (executable-find "ag") 'ag)
|
||||
(and (executable-find "pt") 'pt)
|
||||
(cl-loop for tool in +ivy-project-search-engines
|
||||
if (executable-find (symbol-name tool))
|
||||
return tool)
|
||||
(and (or (executable-find "grep")
|
||||
(executable-find "git"))
|
||||
'grep)
|
||||
@@ -131,11 +131,12 @@ list of: ripgrep, ag, pt, git-grep and grep. If ARG (universal argument),
|
||||
preform search from current directory."
|
||||
(interactive "P")
|
||||
(call-interactively
|
||||
(cond ((executable-find "rg") (if arg #'+helm/rg-from-cwd #'+helm/rg))
|
||||
((executable-find "ag") (if arg #'+helm/ag-from-cwd #'+helm/ag))
|
||||
((executable-find "pt") (if arg #'+helm/pt-from-cwd #'+helm/pt))
|
||||
(arg #'+helm/grep-from-cwd)
|
||||
(#'+helm/grep))))
|
||||
(or (cl-loop for tool in (cl-remove-duplicates +ivy-project-search-engines)
|
||||
if (executable-find (symbol-name tool))
|
||||
return (intern (format "+helm/%s%s" tool (if arg "-from-cwd" ""))))
|
||||
(if arg
|
||||
#'+helm/grep-from-cwd
|
||||
#'+helm/grep))))
|
||||
|
||||
;; Relative to project root
|
||||
;;;###autoload
|
||||
|
Reference in New Issue
Block a user