Open-source project
wincent/ferret avatar
wincent/ferret

Ferret and the multi-file search Vim was missing

🐀 Enhanced multi-file search for Vim

692 stars19 forksVim ScriptBSD-2-Clause

At a glance

What is it?
Ferret is a Vim plugin that wraps ripgrep, The Silver Searcher or Ack into a set of commands with consistent naming, asynchronous searching on Vim 8 and later, and a multi-file replace built on top of the quickfix list. It is small, dependency-light and old enough that its release history is part of the story.
Who is it for?
Ferret is a good fit for a Vim user who searches across a project and then wants to edit the results, because the search command, the list variant and the replace command share a naming scheme and the replace operates on the quickfix list you already have in front of you.
Can I use it commercially?
Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 151 days ago.
What is it written in?
Mainly Vim Script, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.

Editorial analysis

One search verb, four scopes, three backends

Ferret improves Vim's multi-file search in four ways, and the first of them is the command vocabulary.

The base command is :Ack, which searches across multiple files using ripgrep, The Silver Searcher, or Ack. The pattern is passed through to the underlying search program as-is, with no escaping required other than preceding spaces with a single backslash, and the full regular expression syntax of the underlying tool is available. Options are passed through as well.

The backend selection is automatic. rg and ag are used preferentially if present on the system, because they are faster, falling back to ack or ack-grep as needed. So the plugin is a front end over whichever of the three you have, and it prefers the fast ones.

The scope is expressed in the command name, and this is the part worth learning. :Ack searches the files under the current directory and puts results in the quickfix listing. :Back and :Black are the analogous commands scoped to the currently open buffers only. :Quack is scoped to the files currently in the quickfix list. :Lack behaves like :Ack but uses the location-list instead of the quickfix.

That is four names for four different sets of files, which sounds redundant until you have a large project and a small set of buffers you are actively editing. The naming is consistent, and once you know the family, the scope is guessable.

Asynchronous searching on Vim 8, and the single-threaded caveat

On modern versions of Vim, version 8 and higher, or Neovim, searches are performed asynchronously without blocking the UI. The README explains the reasoning plainly: asynchronous searches are preferred because they do not block, despite the fact that Vim itself is single threaded.

That is a real quality of life difference. A synchronous search over a large tree freezes the editor until the search program finishes, and a synchronous substitute over the results does the same thing again. Running the search in the background lets you keep editing while it works.

The readme is also precise about what the pattern is allowed to contain. The pattern goes to the search program unchanged, so only spaces need escaping, with a single backslash. The example given is searching for a Perl-style expression, using ag's regex syntax, written as:

code
:Ack \bfoo[0-9]{2}\ bar\b

The trailing backslash before the space is the whole escaping rule. Everything else, the word boundaries and the character class, is passed straight through, which means you are writing regular expressions for the search backend rather than for Vim's own search syntax.

One consequence is that the regex dialect depends on which backend is installed. An expression that works with ag may not behave identically with Ack, and if you have both rg and ag on your machine the plugin will pick one for you.

The replace is a second command over the same list

The second feature is streamlined multi-file replace, and it is a separate command rather than a flag.

:Acks, mnemonic Ack substitute, is reachable via the shortcut <Leader>r, and it runs a multi-file replace across all the files placed in the quickfix window by a previous :Ack, :Back or :Quack invocation. The scope is exactly the list you are looking at, which is the point: you search, you review the quickfix list, you prune the entries you do not want, and then you replace only across what remains.

There is a matching :Lacks for results that came from :Lack in the location-list.

The mechanism underneath is worth knowing because it explains the shortcuts. Ferret provides :Qargs, which puts the files currently in the quickfix listing into the :args list, where they can be operated on in bulk with the :argdo command. That is what :Acks uses under the covers on older versions of Vim, while on newer versions the built-in :cdo or :cfdo are used instead. :Largs is the location-list analog of :Qargs.

So the design is: normalise the scope into an argument list, then let Vim's own bulk-edit commands do the work. The plugin is not inventing a replace engine, it is arranging the list so the standard tools apply to the right files.

Quickfix window tweaks that reduce friction

The third feature is about the quickfix listing itself, and it is the smallest of the four but the one you touch most.

The listing gets settings to improve its usability, and natural mappings that allow quick removal of items from the list. The stated example is reducing clutter by removing lines you do not intend to make changes to. In practice this is what makes the :Acks workflow tolerable: a search for a common symbol returns hundreds of hits across dozens of files, and most of them are not what you meant. Being able to drop entries with a single key, rather than leaving them in the list and letting the replace touch them, is the difference between a safe edit and a bad afternoon.

Vim's own navigation commands are also adjusted. The :cn, :cp, :cnf and :cpf commands are tweaked to make it easier to immediately identify matches by centering them within the viewport. Those are the next and previous match commands in the quickfix list, and centering the match means the surrounding context of the line is visible rather than the match sitting at the edge of the window.

It is a small change with a disproportionate effect on how fast you can work through a result set, and it is the kind of detail that a general-purpose search tool cannot give you because it has no quickfix window to configure.

Installing with Pathogen, a clone, or a submodule

Ferret is installed with whatever plug-in management system you already use. If you do not have one, the README recommends Pathogen for its simplicity and robustness, and gives the clone command for installing into ~/.vim/bundle:

code
git clone https://github.com/wincent/ferret.git ~/.vim/bundle/ferret

If you manage plug-ins as Git submodules instead, the equivalent after moving into the top level of your superproject is:

code
git submodule add https://github.com/wincent/ferret.git ~/vim/bundle/ferret
git submodule init

Then, if you use Pathogen, the help tags are generated from inside Vim with:

code
:call pathogen#helptags()

The shortcut mappings are on the leader key, with <Leader>a starting a search and <Leader>s searching for the word under the cursor, plus <Leader>l for the location-list variant and <Leader>r for the replace. The README does not document how to change the leader, which is a detail worth checking against your own configuration, since a plugin that assumes a particular leader can either conflict with your setup or simply not fire.

The repository layout is what you would expect for a Vim plugin: plugin/ for the command definitions, autoload/ for the functions, doc/ for the help file, ftplugin/ for filetype detection, plus a test.rb and a .watchmanconfig for the test suite.

A release line that stopped in 2019

The version history is the part of this project that deserves a second look, because it splits the picture in two.

The tagged releases are 5.0 from 2019-06-07, 4.1 from 2019-01-31 and 4.0.2 from 2019-01-11. The repository is not archived, and the last push was on 2026-05-25. So the source tree has been touched well after the last release, but the published version numbers stop in June 2019.

What that means in practice depends on how you install. A Pathogen or submodule install of the default branch gives you the current source, which may include changes that were never versioned. A distribution that tracks tags gives you 5.0, which is a snapshot of the code as it was in 2019.

The version numbering itself is also different from the usual convention. There is no semver structure here, no minor and patch components to speak of, just 4.0.2, 4.1 and 5.0. The 4.0.2 to 4.1 step and the 4.1 to 5.0 step are therefore not comparable to semantic version increments, and there is no documented compatibility promise for the Vim versions supported.

The licence is BSD-2-Clause, which is permissive and requires only that the copyright notice and conditions be retained. There is no compatibility or legal obstacle to adopting it.

Editorial conclusion

Ferret is a good fit for a Vim user who searches across a project and then wants to edit the results, because the search command, the list variant and the replace command share a naming scheme and the replace operates on the quickfix list you already have in front of you. It is a poor fit if you want a single search tool that works identically everywhere, since the plugin deliberately names different scopes differently, and a poor fit if you rely on plugins that manage your Vim directory for you, since the install instructions assume a manual clone or a Git submodule. Before adopting, check that ripgrep or The Silver Searcher is on your path, since Ferret prefers them and falls back to Ack otherwise, and read the version history because the release line stopped at 5.0 in 2019 while the repository itself was pushed to in 2026.

Frequently asked questions

What search backends does Ferret support for Vim?

Ferret provides the :Ack command for searching across multiple files using ripgrep, The Silver Searcher, or Ack. rg and ag are used preferentially when present on the system because they are faster, falling back to ack or ack-grep as needed.

How do I run a multi-file replace with Ferret?

Search first with :Ack, :Back or :Quack, then run :Acks, reachable via the <Leader>r shortcut, to replace across the files in the quickfix list. The location-list equivalent for :Lack results is :Lacks.

How do I install the Ferret plugin for Vim?

Clone it into your bundle directory with git clone https://github.com/wincent/ferret.git ~/.vim/bundle/ferret, or add it as a Git submodule. If you use Pathogen, generate the help tags from inside Vim with :call pathogen#helptags().

When did Ferret stop releasing new versions?

The last tagged release is 5.0 from 2019-06-07, preceded by 4.1 in January 2019 and 4.0.2 in January 2019. The repository is not archived and the last push was on 2026-05-25.

Official sources

  1. Issues
  2. License: BSD-2-Clause
  3. README
  4. Releases
  5. wincent/ferret on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/wincent-ferret.svg)](https://hysenlabs.com/projects/wincent-ferret)

Was this useful?