Multiple .ackrc files (project and global)

240 views
Skip to first unread message

A. S. Budden

unread,
Oct 1, 2008, 8:48:54 AM10/1/08
to ack-...@googlegroups.com
Dear all,

It is possible to configure ack to use multiple ackrc files if they
exist? For example, I would like to have a ~/.ackrc that contains
--smart-case and, for some projects/directories, to have a
./ack_config that contains (e.g.) --ignore-dir=docs

Many thanks,

Al

Andy Lester

unread,
Oct 1, 2008, 10:15:14 AM10/1/08
to ack-...@googlegroups.com


I guess we could have multiple .ackrc, say, /etc/ackrc, ~/.ackrc and
then ./.ackrc, although I'm not sure about the last one.

Thoughts?

xoa

--
Andy Lester => an...@petdance.com => www.petdance.com => AIM:petdance

A. S. Budden

unread,
Oct 1, 2008, 10:35:50 AM10/1/08
to ack-...@googlegroups.com
2008/10/1 Andy Lester <an...@petdance.com>:

>
>
> On Oct 1, 2008, at 7:48 AM, A. S. Budden wrote:
>
>> It is possible to configure ack to use multiple ackrc files if they
>> exist? For example, I would like to have a ~/.ackrc that contains
>> --smart-case and, for some projects/directories, to have a
>> ./ack_config that contains (e.g.) --ignore-dir=docs
>
>
> I guess we could have multiple .ackrc, say, /etc/ackrc, ~/.ackrc and
> then ./.ackrc, although I'm not sure about the last one.
>
> Thoughts?

I think this would be great, although I'm not sure about using
'.ackrc' as the filename for the "current directory" one as it would
be easy to lose as you may not expect there to be hidden files in a
project directory. There could just be an environment variable
defining the filename for a "current directory" ackrc. Then it's up
to the user (and it it is unset, it could default to the current
behaviour of not checking for anything other than ~/.ackrc).

Al

Phil Freo

unread,
Apr 26, 2012, 7:31:59 PM4/26/12
to ack-...@googlegroups.com
I would like to throw in my vote for support for multiple ackrc files.

I'd want to it work just like git - in that you can have a global config file (~/.git or ~/.ackrc) as well as a per project config file (~/myproj/.git/config or ~/myproj/.ackrc)

Whether it recursed up all parent directories, and whether the local config file completely overwrote the global one or just appended to it is all up for grabs -- I'd be much happier regardless of the specifics if there was something like this.

Other people online asking for this:

Andy Lester

unread,
Apr 26, 2012, 7:37:16 PM4/26/12
to ack-...@googlegroups.com

On Apr 26, 2012, at 6:31 PM, Phil Freo wrote:

I'd want to it work just like git - in that you can have a global config file (~/.git or ~/.ackrc) as well as a per project config file (~/myproj/.git/config or ~/myproj/.ackrc)

You must be new to the list.  We're all over that over on ack2.  It's what's taken a lot of time for us to ramp up.

Check our progress at https://github.com/petdance/ack2.  Rob Hoelz and I are working on a list of what's left.

Phil Freo

unread,
Apr 26, 2012, 7:43:48 PM4/26/12
to ack-...@googlegroups.com
You must be new to the list.  We're all over that over on ack2.  It's what's taken a lot of time for us to ramp up.

Check our progress at https://github.com/petdance/ack2.  Rob Hoelz and I are working on a list of what's left.

xoa


Yep - I just saw the list at http://betterthangrep.com/community/, joined it and did a search for this issue and only saw this one thread. Glad to hear it though :)

Andrew Black

unread,
Apr 27, 2012, 4:39:17 PM4/27/12
to ack-...@googlegroups.com
I have taken a broad brush approach and included excluded directories in my ~/.ackrc (even though they only apply to one project). Likewise I have a file types that only apply to one project but so far there is no harm in putting them in my default ackrc.

So I can live without this feature for now. Apologies if your circumstance is differernt!
Andrew


Reply all
Reply to author
Forward
0 new messages