Bind 'SPC h d S' to text search; expand ivy/helm file-search API

This commit is contained in:
Henrik Lissner 2019-12-23 01:51:43 -05:00
parent e8aa293bc0
commit b144a3862a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 38 additions and 14 deletions

View file

@ -196,7 +196,7 @@ selection of all minor-modes, active or not."
(find-file (expand-file-name "index.org" doom-docs-dir)))
;;;###autoload
(defun doom/help-search (&optional initial-input)
(defun doom/help-search-headings (&optional initial-input)
"Search Doom's documentation and jump to a headline."
(interactive)
(doom-completing-read-org-headings
@ -212,6 +212,25 @@ selection of all minor-modes, active or not."
x)
(doom--help-modules-list))))
;;;###autoload
(defun doom/help-search (&optional initial-input)
"Preform a text search on all of Doom's documentation."
(interactive)
(funcall (cond ((featurep! :completion ivy)
#'+ivy-file-search)
((featurep! :completion helm)
#'+helm-file-search)
((rgrep
(read-regexp
"Search for" (or initial-input 'grep-tag-default)
'grep-regexp-history)
"*.org" doom-emacs-dir)
#'ignore))
:query initial-input
:args '("-g" "*.org")
:in doom-emacs-dir
:prompt "Search documentation for: "))
;;;###autoload
(defun doom/help-news-search (&optional initial-input)
"Search headlines in Doom's newsletters."