Treat +ivy/project-search & +default/project-search as counsel-rg

This gives the former commands access to any actions (on C-o) or counsel
configuration meant for counsel-rg.
This commit is contained in:
Henrik Lissner 2019-12-17 23:31:10 -05:00
parent defbed9ac1
commit e6de13b4c9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 7 additions and 3 deletions

View file

@ -52,7 +52,8 @@ workspace."
(unless (executable-find "rg") (unless (executable-find "rg")
(user-error "Couldn't find ripgrep in your PATH")) (user-error "Couldn't find ripgrep in your PATH"))
(require 'helm-rg) (require 'helm-rg)
(let ((helm-rg-default-directory (or in (doom-project-root) default-directory)) (let ((this-command 'helm-rg)
(helm-rg-default-directory (or in (doom-project-root) default-directory))
(helm-rg-default-extra-args (helm-rg-default-extra-args
(delq nil (list (when all-files "-z -uu") (delq nil (list (when all-files "-z -uu")
(unless recursive "--maxdepth 1"))))) (unless recursive "--maxdepth 1")))))

View file

@ -252,7 +252,7 @@ The point of this is to avoid Emacs locking up indexing massive file trees."
(unless (executable-find "rg") (unless (executable-find "rg")
(user-error "Couldn't find ripgrep in your PATH")) (user-error "Couldn't find ripgrep in your PATH"))
(require 'counsel) (require 'counsel)
(let* ((ivy-more-chars-alist '((t . 1))) (let* ((this-command 'counsel-rg)
(project-root (or (doom-project-root) default-directory)) (project-root (or (doom-project-root) default-directory))
(directory (or in project-root)) (directory (or in project-root))
(args (concat (if all-files " -uu") (args (concat (if all-files " -uu")

View file

@ -40,7 +40,10 @@ This uses a search algorithm other than ivy's default.")
`((counsel-rg . +ivy-standard-search) `((counsel-rg . +ivy-standard-search)
(swiper . +ivy-standard-search) (swiper . +ivy-standard-search)
(swiper-isearch . +ivy-standard-search) (swiper-isearch . +ivy-standard-search)
(t . +ivy-alternative-search))) (t . +ivy-alternative-search))
ivy-more-chars-alist
'((counsel-rg . 1)
(t . 3)))
(define-key! (define-key!
[remap switch-to-buffer] #'+ivy/switch-buffer [remap switch-to-buffer] #'+ivy/switch-buffer