Bye bye grep, hello ack!

This past week I’ve been enhancing my Vim configuration, since it’s the editor I use all the time. While browsing for interesting plugins I run across Ack, a plugin that promises to be an enhancement for Vim’s builtin grep capability.

The Vim plugin uses the ack command on your system which is Perl replacement for grep. After discovering it on http://betterthangrep.com I didn’t look back. Ack is so much better than grep for finding text among code!

One of the good things is the fact that Ack will automagically ignore well-known version control systems files. According to the documentation:

Directories ignored by default:
autom4te.cache, blib, build, .bzr, .cdv, cover_db, CVS, darcs, ~.dep,
~.dot, .git, .hg, MTN, ~.nib, .pc, ~.plst, RCS, SCCS, sgbak and .svn

Lets see an usage example:

[gist]https://gist.github.com/717782[/gist]

And we don’t need to explicitly exclude any of the directories listed above, because Ack will do it for us.

Happy ack-ing!

 

Leave a Reply

Your email address will not be published. Required fields are marked *