completion/ivy: revise documentation + slight refactor
This commit is contained in:
parent
45e9bf8754
commit
717d0ec06f
2 changed files with 18 additions and 12 deletions
|
@ -4,7 +4,7 @@ This module adds the Ivy completion backend.
|
||||||
|
|
||||||
I prefer ivy over ido and helm, for its speed and simplicity. With ivy's help and some hackery, I get the following features:
|
I prefer ivy over ido and helm, for its speed and simplicity. With ivy's help and some hackery, I get the following features:
|
||||||
|
|
||||||
+ Project-wide search & replace powered by ~rg~ (falls back to ~ag~)
|
+ Project-wide search & replace powered by ~rg~ and ~ag~
|
||||||
+ Project jump-to navigation ala Command-T, Sublime Text's Jump-to-anywhere or Vim's CtrlP plugin.
|
+ Project jump-to navigation ala Command-T, Sublime Text's Jump-to-anywhere or Vim's CtrlP plugin.
|
||||||
+ Ivy integration for ~M-x~, ~imenu~, ~recentf~ and others.
|
+ Ivy integration for ~M-x~, ~imenu~, ~recentf~ and others.
|
||||||
+ A powerful, interactive in-buffer search using ~swiper~.
|
+ A powerful, interactive in-buffer search using ~swiper~.
|
||||||
|
|
|
@ -62,7 +62,8 @@
|
||||||
;;;###autoload (autoload '+ivy:ag "completion/ivy/autoload/evil" nil t)
|
;;;###autoload (autoload '+ivy:ag "completion/ivy/autoload/evil" nil t)
|
||||||
(evil-define-operator +ivy:ag (beg end query &optional all-files-p directory)
|
(evil-define-operator +ivy:ag (beg end query &optional all-files-p directory)
|
||||||
"Perform a project file search using the silver search. QUERY is a pcre
|
"Perform a project file search using the silver search. QUERY is a pcre
|
||||||
regexp. If omitted, will perform the last known search.
|
regexp. If omitted, the current selection is used. If no selection is active,
|
||||||
|
the last known search is used.
|
||||||
|
|
||||||
If ALL-FILES-P, don't respect .gitignore files and search everything."
|
If ALL-FILES-P, don't respect .gitignore files and search everything."
|
||||||
(interactive "<r><a><!>")
|
(interactive "<r><a><!>")
|
||||||
|
@ -72,26 +73,31 @@ If ALL-FILES-P, don't respect .gitignore files and search everything."
|
||||||
;;;###autoload (autoload '+ivy:rg "completion/ivy/autoload/evil" nil t)
|
;;;###autoload (autoload '+ivy:rg "completion/ivy/autoload/evil" nil t)
|
||||||
(evil-define-operator +ivy:rg (beg end query &optional all-files-p directory)
|
(evil-define-operator +ivy:rg (beg end query &optional all-files-p directory)
|
||||||
"Perform a project file search using ripgrep. QUERY is a regexp. If omitted,
|
"Perform a project file search using ripgrep. QUERY is a regexp. If omitted,
|
||||||
will perform the last known search.
|
the current selection is used. If no selection is active, the last known search
|
||||||
|
is used.
|
||||||
|
|
||||||
If ALL-FILES-P, don't respect .gitignore files and search everything."
|
If ALL-FILES-P, don't respect .gitignore files and search everything.
|
||||||
|
|
||||||
|
NOTE: ripgrep doesn't support multiline searches (yet)."
|
||||||
(interactive "<r><a><!>")
|
(interactive "<r><a><!>")
|
||||||
(let ((+ivy--file-search-all-files-p all-files-p))
|
(let ((+ivy--file-search-all-files-p all-files-p))
|
||||||
(+ivy--file-search 'rg beg end query directory)))
|
(+ivy--file-search 'rg beg end query directory)))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload (autoload '+ivy:ag-cwd "completion/ivy/autoload/evil" nil t)
|
;;;###autoload (autoload '+ivy:ag-cwd "completion/ivy/autoload/evil" nil t)
|
||||||
(evil-define-operator +ivy:ag-cwd (beg end query &optional inhibit-recursion-p)
|
(evil-define-operator +ivy:ag-cwd (beg end query &optional bang)
|
||||||
"The same as :ag, but only searches the current directory. If
|
"The same as :ag, but searches the current directory. If BANG, don't recurse
|
||||||
INHIBIT-RECURSION-P, don't recurse into sub-directories."
|
into sub-directories."
|
||||||
(interactive "<r><a><!>")
|
(interactive "<r><a><!>")
|
||||||
(let ((+ivy--file-search-recursion-p (not inhibit-recursion-p)))
|
(let ((+ivy--file-search-recursion-p (not bang)))
|
||||||
(+ivy:ag beg end query t default-directory)))
|
(+ivy:ag beg end query t default-directory)))
|
||||||
|
|
||||||
;;;###autoload (autoload '+ivy:rg-cwd "completion/ivy/autoload/evil" nil t)
|
;;;###autoload (autoload '+ivy:rg-cwd "completion/ivy/autoload/evil" nil t)
|
||||||
(evil-define-operator +ivy:rg-cwd (beg end query &optional inhibit-recursion-p)
|
(evil-define-operator +ivy:rg-cwd (beg end query &optional bang)
|
||||||
"The same as :rg, but only searches the current directory. If
|
"The same as :rg, but only searches the current directory. If BANG, don't
|
||||||
INHIBIT-RECURSION-P, don't recurse into sub-directories."
|
recurse into sub-directories.
|
||||||
|
|
||||||
|
NOTE: ripgrep doesn't support multiline searches (yet)."
|
||||||
(interactive "<r><a><!>")
|
(interactive "<r><a><!>")
|
||||||
(let ((+ivy--file-search-recursion-p (not inhibit-recursion-p)))
|
(let ((+ivy--file-search-recursion-p (not bang)))
|
||||||
(+ivy:rg beg end query t default-directory)))
|
(+ivy:rg beg end query t default-directory)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue