Remove the_platinum_searcher support
I'm reducing the scope of our project search so we can eventually focus on ripgrep. By specializing I can extend Doom's features for project searching.
This commit is contained in:
parent
7654764713
commit
6ba7c97501
9 changed files with 9 additions and 65 deletions
|
@ -29,7 +29,7 @@
|
|||
|
||||
* Description
|
||||
This module provides Ivy integration for a variety of Emacs commands, as well as
|
||||
a unified interface for project search and replace, powered by ag, rg, pt,
|
||||
a unified interface for project search and replace, powered by ag, rg,
|
||||
git-grep & grep (whichever is available).
|
||||
|
||||
#+begin_quote
|
||||
|
@ -71,7 +71,6 @@ This module optionally depends on one of:
|
|||
|
||||
+ [[https://github.com/BurntSushi/ripgrep][ripgrep]] (rg)
|
||||
+ [[https://github.com/ggreer/the_silver_searcher][the_silver_searcher]] (ag)
|
||||
+ [[https://github.com/monochromegane/the_platinum_searcher][the_platinum_searcher]] (pt)
|
||||
|
||||
Ripgrep is recommended, but the order of its results aren't deterministic and it
|
||||
doesn't support full PCRE (at the time of writing). The_silver_searcher is a
|
||||
|
@ -114,7 +113,7 @@ https://assets.doomemacs.org/completion/ivy/projectile.png
|
|||
|
||||
** Project search & replace
|
||||
This module provides interactive text search and replace using the first search
|
||||
program available on your system (rg, ag, pt, git-grep or grep).
|
||||
program available on your system (rg, ag, git-grep or grep).
|
||||
|
||||
| Keybind | Description |
|
||||
|-----------+---------------------------------|
|
||||
|
@ -136,7 +135,6 @@ current directory (recursively), respectively:
|
|||
|
||||
+ ~+ivy/ag~ / ~+ivy/ag-from-cwd~
|
||||
+ ~+ivy/rg~ / ~+ivy/rg-from-cwd~
|
||||
+ ~+ivy/pt~ / ~+ivy/pt-from-cwd~
|
||||
+ ~+ivy/grep~ / ~+ivy/grep-from-cwd~
|
||||
|
||||
The universal argument (=SPC u= for evil users; =C-u= otherwise) changes the
|
||||
|
@ -149,11 +147,9 @@ This module also provides Ex Commands for evil users:
|
|||
|-----------------------+------------------------------------------------|
|
||||
| ~:ag[!] [QUERY]~ | Search project w/ ag[fn:1] |
|
||||
| ~:rg[!] [QUERY]~ | Search project w/ rg[fn:1] |
|
||||
| ~:pt[!] [QUERY]~ | Search project w/ pt[fn:1] |
|
||||
| ~:grep[!] [QUERY]~ | Search project w/ git-grep/grep[fn:1] |
|
||||
| ~:agcwd[!] [QUERY]~ | Search this directory w/ the_silver_searcher |
|
||||
| ~:rgcwd[!] [QUERY]~ | Search this directory w/ ripgrep |
|
||||
| ~:ptcwd[!] [QUERY]~ | Search this directory w/ the_platinum_searcher |
|
||||
| ~:grepcwd[!] [QUERY]~ | Search this directory w/ git-grep/grep |
|
||||
|
||||
The optional BANG functions is equivalent to the universal argument for the
|
||||
|
|
|
@ -17,12 +17,6 @@
|
|||
;;
|
||||
;; Project searching
|
||||
|
||||
;;;###autoload (autoload '+ivy:pt "completion/ivy/autoload/evil" nil t)
|
||||
(evil-define-command +ivy:pt (all-files-p query)
|
||||
"Ex interface for `+ivy/pt'"
|
||||
(interactive "<!><a>")
|
||||
(+ivy/pt all-files-p query))
|
||||
|
||||
;;;###autoload (autoload '+ivy:grep "completion/ivy/autoload/evil" nil t)
|
||||
(evil-define-command +ivy:grep (all-files-p query)
|
||||
"Ex interface for `+ivy/grep'"
|
||||
|
@ -42,12 +36,6 @@
|
|||
(+ivy/rg all-files-p query))
|
||||
|
||||
|
||||
;;;###autoload (autoload '+ivy:pt-from-cwd "completion/ivy/autoload/evil" nil t)
|
||||
(evil-define-command +ivy:pt-from-cwd (query &optional recurse-p)
|
||||
"Ex interface for `+ivy/pt-from-cwd'."
|
||||
(interactive "<a><!>")
|
||||
(+ivy/pt-from-cwd (not recurse-p) query))
|
||||
|
||||
;;;###autoload (autoload '+ivy:grep-from-cwd "completion/ivy/autoload/evil" nil t)
|
||||
(evil-define-command +ivy:grep-from-cwd (query &optional recurse-p)
|
||||
"Ex interface for `+ivy/grep-from-cwd'."
|
||||
|
|
|
@ -399,20 +399,13 @@ order.
|
|||
(counsel-projectile-grep))
|
||||
(counsel-projectile-grep)))))
|
||||
(`ag
|
||||
(let ((args (concat (if all-files " -a")
|
||||
(let ((args (concat " -S" (if all-files " -a")
|
||||
(unless recursive " --depth 1"))))
|
||||
(counsel-ag query directory args (format prompt args))))
|
||||
(`rg
|
||||
(let ((args (concat (if all-files " -uu")
|
||||
(let ((args (concat " -S" (if all-files " -uu")
|
||||
(unless recursive " --maxdepth 1"))))
|
||||
(counsel-rg query directory args (format prompt args))))
|
||||
(`pt
|
||||
(let ((counsel-pt-base-command
|
||||
(concat counsel-pt-base-command
|
||||
(if all-files " -U")
|
||||
(unless recursive " --depth=1")))
|
||||
(default-directory directory))
|
||||
(counsel-pt query)))
|
||||
(_ (error "No search engine specified"))))))
|
||||
|
||||
(defun +ivy--get-command (format)
|
||||
|
@ -451,8 +444,6 @@ ARG (universal argument), include all files, even hidden or compressed ones."
|
|||
;;;###autoload (autoload '+ivy/rg-from-cwd "completion/ivy/autoload/ivy" nil t)
|
||||
;;;###autoload (autoload '+ivy/ag "completion/ivy/autoload/ivy" nil t)
|
||||
;;;###autoload (autoload '+ivy/ag-from-cwd "completion/ivy/autoload/ivy" nil t)
|
||||
;;;###autoload (autoload '+ivy/pt "completion/ivy/autoload/ivy" nil t)
|
||||
;;;###autoload (autoload '+ivy/pt-from-cwd "completion/ivy/autoload/ivy" nil t)
|
||||
;;;###autoload (autoload '+ivy/grep "completion/ivy/autoload/ivy" nil t)
|
||||
;;;###autoload (autoload '+ivy/grep-from-cwd "completion/ivy/autoload/ivy" nil t)
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ When 'everything, also preview virtual buffers")
|
|||
"An alist of tags for `+ivy/tasks' to include in its search, whose CDR is the
|
||||
face to render it with.")
|
||||
|
||||
(defvar +ivy-project-search-engines '(rg ag pt)
|
||||
(defvar +ivy-project-search-engines '(rg ag)
|
||||
"What search tools for `+ivy/project-search' (and `+ivy-file-search' when no
|
||||
ENGINE is specified) to try, and in what order.
|
||||
|
||||
|
@ -230,11 +230,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
(setq counsel-locate-cmd #'counsel-locate-cmd-mdfind))
|
||||
(setq counsel-find-file-ignore-regexp "\\(?:^[#.]\\)\\|\\(?:[#~]$\\)\\|\\(?:^Icon?\\)"
|
||||
counsel-describe-function-function #'helpful-callable
|
||||
counsel-describe-variable-function #'helpful-variable
|
||||
;; Add smart-casing (-S) to default command arguments:
|
||||
counsel-rg-base-command "rg -S --no-heading --line-number --color never %s ."
|
||||
counsel-ag-base-command "ag -S --nocolor --nogroup %s"
|
||||
counsel-pt-base-command "pt -S --nocolor --nogroup -e %s")
|
||||
counsel-describe-variable-function #'helpful-variable)
|
||||
|
||||
(add-to-list 'swiper-font-lock-exclude #'+doom-dashboard-mode nil #'eq)
|
||||
|
||||
|
@ -273,7 +269,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
(with-ivy-window (insert (format "[[%s]]" path)))) "insert org-link (abs. path)")))
|
||||
|
||||
(ivy-add-actions
|
||||
'counsel-ag ; also applies to `counsel-rg' & `counsel-pt'
|
||||
'counsel-ag ; also applies to `counsel-rg'
|
||||
'(("O" +ivy-git-grep-other-window-action "open in other window"))))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue