sponsor Vim development Vim logo go to HTTPS page Vim Book Ad

Ferret : Enhanced multi-file search for Vim

 script karma  Rating 9/3, Downloaded by 556    Comments, bugs, improvements  Vim wiki

created by
Greg Hurrell
 
script type
utility
 
description
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
escaping.

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
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 by |:Acks|
to do its work.
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ferret-1.4.zip 1.4 2017-01-22 7.0 Greg Hurrell - Drop broken support for `grep`, printing a prompt to install `rg`, `ag`, or
  `ack`/`ack-grep` instead.
- If an `ack` executable is not found, search for `ack-grep`, which is the
  name used on Debian-derived distros.
ferret-1.3.zip 1.3 2017-01-08 7.0 Greg Hurrell - 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`).
ferret-1.2a.zip 1.2a 2016-05-16 7.4 Greg Hurrell - 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|.
ferret-1.1.1.zip 1.1.1 2016-03-07 7.0 Greg Hurrell - Fix another edge case when searching for patterns containing "#", only manifesting under dispatch.vim.
ferret-1.1.zip 1.1 2016-03-07 7.0 Greg Hurrell - 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.
ferret-1.0.zip 1.0 2015-12-28 7.0 Greg Hurrell - Fix broken |:Qargs| command (patch from Daniel Silva).
- Add |g:FerretQFHandler| and |g:FerretLLHandler| options (patch from Daniel
  Silva).
- 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.
ferret-0.3.zip 0.3 2015-07-24 7.0 Greg Hurrell - Added highlighting of search pattern and related |g:FerretHlsearch| option
  (patch from Nelo-Thara Wallus).
- Add better error reporting for failed or incorrect searches.
ferret-0.2.zip 0.2 2015-07-16 7.0 Greg Hurrell - Added |FerretDidWrite| and |FerretWillWrite| autocommands (patch from Joe
  Lencioni).
- Add |<Plug>(FerretAcks)| mapping (patch from Nelo-Thara Wallus).
ferret-0.1.zip 0.1 2015-07-08 7.0 Greg Hurrell Initial upload
ip used for rating: 54.144.194.161

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo