Ferret : Enhanced multi-file search for Vim
| script karma
Downloaded by 722
Comments, bugs, improvements
|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
ripgrep (https://github.com/BurntSushi/ripgrep), The Silver Searcher
(https://github.com/ggreer/the_silver_searcher), or Ack
(http://beyondgrep.com/). Support for passing options through to the
underlying search command exists, along with the ability to use full regular
expression syntax without doing special escaping. On modern versions of Vim
(version 8 or higher, or Neovim), searches are performed asynchronously
(without blocking the UI).
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|.
|:Back| and |:Black| are analogous to |:Ack| and |:Lack|, but scoped to search
within currently open buffers only.
2. Streamlined multi-file replace ~
The companion to |:Ack| is |:Acks| (mnemonic: "Ack substitute", accessible via
shortcut <leader>r), which allows you to run a multi-file replace across all
the files placed in the |quickfix| window by a previous invocation of |:Ack| (or
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 viewport.
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 on older
versions of Vim by |:Acks| to do its work (on newer versions the built-in
|:cfdo| is used instead).
Rating scripts is only available on the
script versions (upload new version)
Click on the package to download.
ip used for rating: 188.8.131.52
||- Improve handling of backslash escapes (https://github.com/wincent/ferret/issues/41).
- Add |g:FerretAutojump|.
- Drop support for vim-dispatch.
||- Add support for Neovim, along with |g:FerretNvim| setting.
||- Improvements to the handling of very large result sets (due to wide lines or many results).
- Added |g:FerretLazyInit|.
- Added missing documentation for |g:FerretJob|.
- Added |g:FerretMaxResults|.
- Added feature-detection for `rg` and `ag`, allowing Ferret to gracefully work with older versions of those tools that do not support all desired command-line switches.
||- 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).