From 717d0ec06f737a85a4d500b2ebde3dba8dbb6c08 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 27 May 2017 14:47:59 +0200 Subject: [PATCH] completion/ivy: revise documentation + slight refactor --- modules/completion/ivy/README.org | 2 +- modules/completion/ivy/autoload/evil.el | 28 +++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/modules/completion/ivy/README.org b/modules/completion/ivy/README.org index 34c4f524c..3268e082f 100644 --- a/modules/completion/ivy/README.org +++ b/modules/completion/ivy/README.org @@ -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: -+ 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. + Ivy integration for ~M-x~, ~imenu~, ~recentf~ and others. + A powerful, interactive in-buffer search using ~swiper~. diff --git a/modules/completion/ivy/autoload/evil.el b/modules/completion/ivy/autoload/evil.el index 224d8cfd3..19be4d08a 100644 --- a/modules/completion/ivy/autoload/evil.el +++ b/modules/completion/ivy/autoload/evil.el @@ -62,7 +62,8 @@ ;;;###autoload (autoload '+ivy:ag "completion/ivy/autoload/evil" nil t) (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 -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." (interactive "") @@ -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) (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, -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 "") (let ((+ivy--file-search-all-files-p all-files-p)) (+ivy--file-search 'rg beg end query directory))) ;;;###autoload (autoload '+ivy:ag-cwd "completion/ivy/autoload/evil" nil t) -(evil-define-operator +ivy:ag-cwd (beg end query &optional inhibit-recursion-p) - "The same as :ag, but only searches the current directory. If -INHIBIT-RECURSION-P, don't recurse into sub-directories." +(evil-define-operator +ivy:ag-cwd (beg end query &optional bang) + "The same as :ag, but searches the current directory. If BANG, don't recurse +into sub-directories." (interactive "") - (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))) ;;;###autoload (autoload '+ivy:rg-cwd "completion/ivy/autoload/evil" nil t) -(evil-define-operator +ivy:rg-cwd (beg end query &optional inhibit-recursion-p) - "The same as :rg, but only searches the current directory. If -INHIBIT-RECURSION-P, don't recurse into sub-directories." +(evil-define-operator +ivy:rg-cwd (beg end query &optional bang) + "The same as :rg, but only searches the current directory. If BANG, don't +recurse into sub-directories. + +NOTE: ripgrep doesn't support multiline searches (yet)." (interactive "") - (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)))