Ferret : Enhanced multi-file search for Vim
| script karma
Downloaded by 556
Comments, bugs, improvements
script versions (upload new version)
|Ferret improves Vim's multi-file search in four ways:
1. Powerful multi-file search ~
Ferret provides an |:Ack| command for searching across multiple files using
The Silver Searcher (https://github.com/ggreer/the_silver_searcher), Ack
(http://beyondgrep.com/), or Grep (http://www.gnu.org/software/grep/). Support
for passing options through to the underlying search command exists, along
with the ability to use full regular expression syntax without doing special
Shortcut mappings are provided to start an |:Ack| search (<leader>a) or to
search for the word currently under the cursor (<leader>s).
Results are normally displayed in the |quickfix| window, but Ferret also
provides a |:Lack| command that behaves like |:Ack| but uses the
|location-list| instead, and a <leader>l mapping as a shortcut to |:Lack|.
Finally, Ferret offers integration with dispatch.vim
(https://github.com/tpope/vim-dispatch), which enables asynchronous searching
despite the fact that Vim itself is single-threaded.
2. Streamlined multi-file replace ~
The companion to |:Ack| is |:Acks| (mnemonic: "Ack substitute"), which allows
you to run a multi-file replace across all the files placed in the |quickfix|
window by a previous invocation of |:Ack|.
3. Quickfix listing enhancements ~
The |quickfix| listing itself is enhanced with settings to improve its
usability, and natural mappings that allow quick removal of items from the
list (for example, you can reduce clutter in the listing by removing lines
that you don't intend to make changes to).
Additionally, Vim's |:cn|, |:cp|, |:cnf| and |:cpf| commands are tweaked to
make it easier to immediately identify matches by centering them within the
4. Easy operations on files in the quickfix listing ~
Finally, Ferret provides a |:Qargs| command that puts the files currently in
the |quickfix| listing into the |:args| list, where they can be operated on in
bulk via the |:argdo| command. This is what's used under the covers by |:Acks|
to do its work.
Click on the package to download.
ip used for rating: 188.8.131.52
||- Drop broken support for `grep`, printing a prompt to install `rg`, `ag`, or
- If an `ack` executable is not found, search for `ack-grep`, which is the
name used on Debian-derived distros.
||- Reset |'errorformat'| before each search (fixes issue #31).
- Added |:Back| and |:Black| commands, analogous to |:Ack| and |:Lack| but scoped to search within currently open buffers only.
- Change |:Acks| to use |:cfdo| when available rather than |:Qargs| and |:argdo|, to avoid polluting the |arglist|.
- Remove superfluous |QuickFixCmdPost| autocommands, resolving clash with Neomake plug-in (patch from Tom Dooner, #36).
- Add support for searching with ripgrep (`rg`).
||- Add optional support for running searches asynchronously using Vim's |+job| feature (enabled by default in sufficiently recent versions of Vim); see |g:FerretJob|, |:FerretCancelAsync| and |:FerretPullAsync|.
||- Fix another edge case when searching for patterns containing "#", only manifesting under dispatch.vim.
||- Fix edge case when searching for strings of the form "<foo>".
- Fix edge case when searching for patterns containing "#" and "%".
- Provide completion for `ag` and `ack` options when using |:Ack| and |:Lack|.
- Fix display of error messages under dispatch.vim.
||- Fix broken |:Qargs| command (patch from Daniel Silva).
- Add |g:FerretQFHandler| and |g:FerretLLHandler| options (patch from Daniel
- Make |<Plug>| mappings accessible even |g:FerretMap| is set to 0.
- Fix failure to report filename when using `ack` and explicitly scoping
search to a single file (patch from Daniel Silva).
- When using `ag`, report multiple matches per line instead of just the first
(patch from Daniel Silva).
- Improve content and display of error messages.
||- Added highlighting of search pattern and related |g:FerretHlsearch| option
(patch from Nelo-Thara Wallus).
- Add better error reporting for failed or incorrect searches.
||- Added |FerretDidWrite| and |FerretWillWrite| autocommands (patch from Joe
- Add |<Plug>(FerretAcks)| mapping (patch from Nelo-Thara Wallus).