ack.vim 0

Vim plugin for the Perl module / CLI script 'ack'


This fork of ack.vim has the following differences over the official version:

  • If :Ack is invoked when something is marked in visual mode, that something is used as a search term.
  • Ability to manage options and ignore dirs a bit more easily with :AckOption and :AckIgnore.
  • Ability to run the last :Ack command again with :AckRerun.

See the docs for more details.

This plugin is a front for the Perl module App::Ack. Ack can be used as a replacement for 99% of the uses of grep. This plugin will allow you to run ack from vim, and shows the results in a split window.



You will need the ack(>= 2.0), of course, to install it follow the manual

The Plugin

To install it is recommended to use one of the popular package managers for Vim, rather than installing by drag and drop all required files into your .vim folder.

Manual (not recommended)

Just download the plugin and put it in your ~/.vim/(or %PROGRAMFILES%/Vim/vimfiles on windows)


Bundle 'mileszs/ack.vim'


NeoBundle 'mileszs/ack.vim'


:Ack [options] {pattern} [{directories}]

Search recursively in {directory} (which defaults to the current directory) for the {pattern}.

Files containing the search term will be listed in the split window, along with the line number of the occurrence, once for each occurrence. [Enter] on a line in this window will open the file, and place the cursor on the matching line.

Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use :Ack, :AckAdd, :LAck, and :LAckAdd respectively. (See doc/ack.txt, or install and :h Ack for more information.)

For more ack options see ack documentation

Keyboard Shortcuts

In the quickfix window, you can use:

o    to open (same as enter)
O    to open and close quickfix window
go   to preview file (open but maintain focus on ack.vim results)
t    to open in new tab
T    to open in new tab silently
h    to open in horizontal split
H    to open in horizontal split silently
v    to open in vertical split
gv   to open in vertical split silently
q    to close the quickfix window

If you wish to turn them off, set g:ack_apply_qmappings and/or g:ack_apply_lmappings to 0:

let g:ack_apply_qmappings = 0
let g:ack_apply_lmappings = 0

This Vim plugin is derived (and by derived, I mean copied, essentially) from Antoine Imbert’s blog post Ack and Vim Integration (in particular, the function at the bottom of the post). I added a help file that provides just enough reference to get you going. I also highly recommend you check out the docs for the Perl script ‘ack’, for obvious reasons: ack - grep-like text finder.


Some characters have special meaning, and need to be escaped your search pattern. For instance, ‘#’. You have to escape it like this :Ack '\\\#define foo' to search for ‘#define foo’. (From blueyed in issue #5.)



  • Remove support to ack 1.x
  • Start to use a Changelog
  • Use autoload directory to define functions, instead of plugin.
  • Add option to auto fold the results(g:ack_autofold_results)
  • Improve documentation, list all options and shortcuts
  • Improve highlight option to work when passes directories or use quotes.
  • Add g:ack_mapping
  • Add g:ack_default_options
  • Add a help toggle ?(like NERDTree)


  • Fixes #124. Bug with g:ack_autofold_results



  • Fixes #127. Use &l:hlsearch instead of v:hlsearch to keep compatibility with versions that does not have this variable.


  • Fixes #128. Always apply mappings, even when using vim-dispatch.


  • Fixes #128. Fixes the errorformat for ack when using vim-dispatch.
  • Do not use vim-dispatch by default. To use vim-dispath must set g:ack_use_dispatch


  • Fixes highlight function to work when user passes options. Ex.: Ack -i test Thank’s @mannih. (#131, #134)


  • Fixes highlight function to work when passes more than one option, or options with double dashes(–option) Thank’s to @MiguelLatorre and @mannih


  • Fixes (again) highlight, now using negative look behind.
  • Change mappings o and O to behave as documented

Related Repositories



Vim plugin for the Perl module / CLI script 'ack' ...



Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack' ...



An ack.vim alternative mimics Ctrl-Shift-F on Sublime Text 2 ...



dotfiles for: ack, git, bash, ruby, rails, vim ...



git ack vim regex JavaScript and other guides ...

Top Contributors

kassio mileszs AndrewRadev tpope blueyed mMontu carlosgaldino Linuus unceus troydm c9s brianpeiris thebinarypenguin ilyakatz technicalpickles jdonaldson sickill Soares rizzatti imtapps airblade bitboxer ciupicri nugend gnap axelson jlund3 jeremyckahn juanpabloaj pope