sponsor Vim development Vim logo Vim Book Ad

ack.vim : Plugin for the Perl module / CLI script 'ack'

 script karma  Rating 169/65, Downloaded by 8700  Comments, bugs, improvements  Vim wiki

created by
Miles Sterrett
script type
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.

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.

Where you would use :grep, :grepadd, :lgrep, and :lgrepadd, you can use :Ack, :AckAdd, :LAck, and :LAckAdd respectively.

For more information, and to check out the unstable, development version of the plugin, go here: http://github.com/mileszs/ack.vim/tree/master

This Vim plugin is derived (and by derived, I mean copied, essentially) from Antoine Imbert's blog post Ack and Vim Integration (http://blog.ant0ine.com/2007/03/ack_and_vim_integration.html) (in particular, the function at the bottom of the post).
install details

You have to install ack, of course.

Install on Ubuntu with:

sudo apt-get install ack-grep

Install on Gentoo with:

sudo emerge ack

Install with MacPorts:

sudo port install p5-app-ack

Install with Gentoo Prefix

emerge ack

Otherwise, you are on your own.

The Plugin

Unpack the gzipped archive from within ~/.vim, and you should be good to go.

mv ack.tar.gz ~/.vim
cd ~/.vim
tar xvzf ack.tar.gz

Otherwise, the file ack.vim goes in ~/.vim/plugin, and the ack.txt file belongs in ~/.vim/doc.

Be sure to run

:helptags ~/.vim/doc


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
ack.tar.gz 0.3.1 2009-04-21 6.0 Miles Sterrett Added :redraw!
ack.tar.gz 0.3 2009-03-05 6.0 Miles Sterrett Initial upload
ip used for rating:

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.