Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Enable '-x' as shortcut for '--ignore-dir' #145

Boldewyn opened this Issue · 11 comments

3 participants


Besides the types and -i switches, what I use most is --ignore-dir. It would be a productivity enhancement to also use a short parameter for this. My suggestion is -x, since it's mnemonic and still free.


I know this is a bad solution, but you can add -x support via .bashrc like so:

# Support both -x=<dir> and --x=<dir>
function ack {
    local ack_=$(which ack)
    local args=$@
    local valid_args=${args// --x=/ --ignore-dir=}
    valid_args=${valid_args// -x=/ --ignore-dir=}
    $ack_ $valid_args

-x now has a different meaning in ack 2.

@petdance petdance closed this

I use a lot the --ignore-dir option and I wrote a little wrapper for it as u can see above.
This option name is too long to write it every time.
It would be so nice to have an abbreviation for it.
Some --xd maybe, I do not know.


Is it always the same --ignore-dir? Can you put it in your ~/.ackrc file? In ack2, you can have per-project .ackrc files, too. Plus, it's much more flexible.


No, it varies...
I usually do like so:

ack query
ack --ignore-dir=html query
ack --ignore-dir=html --ignore-dir=css query

At start I do not know, how much results I will get so I search everywhere.
If I get too much results I start reducing search places.


You could also try --nohtml and --nocss, if those are the only two places that CSS and HTML are held.


This was just an example )
I also know about filetype options.
But in my case it is not so easy to configure all possible cases in .ackrc.
All I am asking is: why not just add an abbreviation for existing option?


Do this, please: Make a new issue in, since this project is going away. Then, bring it up on the ack-users list. I'd like to see what people think about the idea. I don't want to go adding options for a single person's use, but maybe there are a lot of people who think "Yeah! That would be great"


What do you mean by:

Then, bring it up on the ack-users list.



You're not on the ack-users mailing list, I take it.


Thank you )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.