Configure ack on a per-directory basis

My goal is to not have to always tell ack which directories to grep in a given project (if I don't, it's slow because it scans non-source folders as well). I've so far come up with puting an executable ./ack script in the project folder that delegates to the global ack command with some extra options, but ideally I would have something like .ackrc in that project directory and ack would just pick that up automatically.

This is what I currently have:

#!/usr/bin/env sh
ack $@ src subproj1/src subproj2/src subproj3/src
1

1 Answer

ack 2.0 supports per-project .ackrc files.

Make sure that you use ack 2.12 or above because previous versions of 2.x have a security hole with those .ackrc files.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like