ctrlsf.vim: searching with ack or rg and editing the results before they touch disk
A text searching plugin mimics Ctrl-Shift-F on Sublime Text 2
At a glance
- What is it?
- ctrlsf.vim wraps ack, ag, pt or rg in a Vim window that runs asynchronously on Vim 8.0.1039+ and Neovim, lets you edit matches in place, then writes the changes back to the source files. The edit mode cannot insert lines and refuses to write a file whose content changed since the search, both deliberate limits on a plugin that predates most of its competition.
- Who is it for?
- ctrlsf.vim fits a Vim or Neovim user on Vim 8.0.1039 or newer who already has one of ack, ag, pt or rg installed, wants the whole project search to land in an editable buffer, and is comfortable wiring up `<Plug>` mappings rather than typing `:CtrlSF` every time. It does not fit anyone who needs to insert lines during a refactor, or who wants to work in files that are changing underneath the search.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 166 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 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The search engine does the work, Vim holds the result
ctrlsf.vim is not a search engine. It is a plugin that drives one of four external programs, ack, ag, pt or rg, and then presents the output as an editable Vim buffer. The README's installation step 1 is explicit that you must already have one of them installed, and adds a narrower caveat: currently only Ack2 is supported by plan.
That is the whole architecture. Search runs as a child process, output is parsed into lines with a file and a match, and those lines become a scratch buffer you can navigate, edit and save back. The plugin is described as mimics Ctrl-Shift-F on Sublime Text 2, and that comparison is accurate about what you get: a project-wide search that leaves you somewhere you can work.
Installation itself is a package manager line. With vim-plug:
Plug 'dyng/ctrlsf.vim'The README also names pathogen, vundle and neobundle as alternatives, so nothing here is specific to one plugin ecosystem.
Async on Vim 8.0.1039+, synchronous on anything older
The asynchronous behavior is the feature that requires a modern Vim. The README states it works in asynchronous mode for Vim 8.0.1039+ and for Neovim, and falls back to synchronous for older versions of Vim.
The difference in practice is that during an async search you can keep exploring and editing other files, and pressing `Ctrl-C` stops the running search. On older Vim, the search blocks the editor until the child process finishes, which on a large tree is the difference between a usable tool and a stall.
That version boundary is worth noting alongside the maintenance facts. The last push was on 2026-05-10 and the repository publishes no GitHub releases, so there is no versioned upgrade path, no changelog in the README and no semantic version to pin. You either follow master or you vendor a copy.
Two window styles, and the key that switches between them
The plugin has two views, which is the detail that decides whether it fits your habits. There is a normal view described as a sublime-like rich context result window with adjustable context, and a compact view described as similar to Vim's quickfix windows. You switch between them with `M` inside the CtrlSF window.
The quickfix-like option is the one to know about if you came from ack.vim, and it is also the one most people discover late, since the default is the richer window.
Navigation keys inside the result window fall into three groups. Opening the match: `Enter`, `o` or `double-click` opens the file in the window CtrlSF was launched from, `t` opens a new tab, `p` previews without leaving, `P` previews and switches focus, `O` opens and always leaves the CtrlSF window, and `T` opens a tab but keeps focus in CtrlSF. Moving between matches: `<C-J>` and `<C-K>` step through matches, `<C-N>` and `<C-P>` jump to the next and previous file. Then there is `<C-T>`, which hands navigation to fzf if you have it installed.
The open-in-original-window behavior of `Enter` is worth understanding rather than fighting. Results open back where you started, which keeps your context, but it also means the search window and the file window trade places.
Edit mode is the reason to use this over plain ack
You can edit the result buffer as if it were a normal file. There is no mode to enter. When you finish and save, CtrlSF asks for confirmation, `y` or just Enter applies the changes to the actual files, and `g:ctrlsf_confirm_save` set to 0 turns the confirmation off.
The workflow the README demos is renaming `FocusWindow()` to `Focus()` across multiple files, and it recommends pairing edit mode with vim-multiple-cursors. A rename across a project is exactly the operation where a search-results buffer beats a quickfix list, because the buffer is editable text and cursors can hit every occurrence.
Undo behaves as you would hope: press `u` and save again. So a bad rename is one save and one undo away.
Then there are two limits, and both are real boundaries rather than bugs. You can modify and delete lines but you cannot insert, with the README noting that if insertion turns out to be needed it will be implemented later. And if a file's content has changed since the last search, CtrlSF refuses to write your changes to that file, for what the README calls a safety concern. The rule of thumb it gives is to invoke a new search before editing, or run `:CtrlSFUpdate`.
Mappings are the difference between usable and annoying
The README is unusually direct about this: it strongly recommends setting up maps, because typing 8 characters for every single search is a boring and painful experience, and because one of the most useful features, Search Visual Selected Word, is reachable by map only.
`<Plug>` maps exist for prompt-only input, searching the visual selection as a path you can extend, executing that search immediately, searching the word under the cursor, doing the same with word boundaries added, and reusing Vim's last search pattern. The README's own example:
nmap <C-F>f <Plug>CtrlSFPrompt
vmap <C-F>f <Plug>CtrlSFVwordPath
vmap <C-F>F <Plug>CtrlSFVwordExec
nmap <C-F>n <Plug>CtrlSFCwordPath
nmap <C-F>p <Plug>CtrlSFPwordPath
nnoremap <C-F>o :CtrlSFOpen<CR>
nnoremap <C-F>t :CtrlSFToggle<CR>
inoremap <C-F>t <Esc>:CtrlSFToggle<CR>Note the insert-mode mapping escaping with `<Esc>` before calling the toggle, which is the standard workaround for a normal-mode command in insert mode.
Collisions are expected and configurable. The README notes some default keys may conflict with keys you use while editing, and points at `g:ctrlsf_mapping` for customization, with `:h g:ctrlsf_mapping` as the reference.
Reopening and toggling avoid re-running the search
Two commands exist for window management rather than searching. `:CtrlSFOpen` reopens the CtrlSF window after you closed it, and the README explains why it is free: it does not invoke the same but new search. `:CtrlSFToggle` is available as well.
That distinction matters on a large repository, where a search that takes a few seconds is a recurring tax. Reopening a buffer you already have is instant, so the sequence of open, jump to a file, come back, jump to another file stays fast.
The README also notes that you can always quit with `q`, close a preview window with `q`, and stop a background search with `<C-C>`.
Where this plugin stops being enough
The no-insert limitation is the first. It is fine for renaming and for replacing expressions, and wrong the moment your refactor needs a new argument list or an added line. The plugin author flags it as a known gap.
The staleness refusal is the second and it will surprise you if you do not expect it. If a formatter, a language server or another teammate changes a file between your search and your save, CtrlSF declines to write and you have to search again. On a codebase with background formatters running, that is a frequent interruption.
The engine constraint is the third. And the plugin is for Vim-family editors only; there is no LSP-based search story and no semantic matching, since the search is entirely textual and regex-based.
Finally, the licensing question is unresolved in the repository metadata, which reports no license for the project. For a plugin distributed through a package manager that is usually fine, but if your organization requires a license file before vendoring anything into a product image, that check comes first.
Against the built-in quickfix grep and against fzf
The other comparison is a fuzzy finder such as fzf with ripgrep. ctrlsf.vim actually acknowledges this one: its `<C-T>` mapping hands navigation to fzf inside the CtrlSF window when fzf is installed. So the two are complementary rather than rivals in the way the plugin's own positioning sometimes suggests. ctrlsf.vim is designed around the edit-and-write-back loop across a completed search.
The honest summary is that ctrlsf.vim occupies a narrow, real niche: external-engine search with an editable, savable result buffer. If your main project-wide operation is rename, that niche is exactly what you want. If it is exploration, fzf with rg covers it without the write-back complexity.
Editorial conclusion
ctrlsf.vim fits a Vim or Neovim user on Vim 8.0.1039 or newer who already has one of ack, ag, pt or rg installed, wants the whole project search to land in an editable buffer, and is comfortable wiring up `<Plug>` mappings rather than typing `:CtrlSF` every time. It does not fit anyone who needs to insert lines during a refactor, or who wants to work in files that are changing underneath the search. Before installing, pick your search engine and confirm only Ack2 is supported by plan, set your own `g:ctrlsf_mapping` rather than accepting defaults that collide with your editing keys, and note that the last push was on 2026-05-10 with no GitHub releases published.
Frequently asked questions
How do I install ctrlsf.vim?
First install ack, ag, pt or rg, since ctrlsf.vim drives one of them as a child process. Then install the plugin with a package manager, for example with vim-plug: `Plug 'dyng/ctrlsf.vim'`. pathogen, vundle and neobundle are also named in the README.
Does ctrlsf.vim support asynchronous search?
Yes, on Vim 8.0.1039 or newer and on Neovim, where you can keep editing other files during the search and press Ctrl-C to stop it. On older versions of Vim it falls back to synchronous searching.
How do I edit search results and save them back to the files?
Edit the result buffer directly, then save. CtrlSF asks for confirmation, and `y` or Enter applies the changes to the actual files. Setting `g:ctrlsf_confirm_save` to 0 turns the confirmation off. Undoing works with `u` followed by another save.
What are the limitations of ctrlsf.vim edit mode?
You can modify and delete lines but not insert them. And if a file's content has varied from the last search, CtrlSF refuses to write your changes to it, so the recommended approach is to run a new search before editing or use `:CtrlSFUpdate`.
How do I change the default key mappings in ctrlsf.vim?
Set `g:ctrlsf_mapping` to customize them, with `:h g:ctrlsf_mapping` as the reference. The README warns that some defaults may conflict with keys you already use while editing, and recommends setting up `<Plug>` maps such as `<Plug>CtrlSFPrompt` and `<Plug>CtrlSFVwordPath`.
Official sources
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.
[](https://hysenlabs.com/projects/dyng-ctrlsf-vim)Was this useful?