Re:Ack - better than grep, a power search tool for programmers
by boucher on Thursday December 03, 2009 @08:02PM
(#975564)
How does one add a custom type to ack and get it to stick? Per the man page, I tried:
Doesn't work. I can append that to a query:
And it will search .j files for CPWindowController, but then it immediately forgets .j and the objj type.
[ Parent
| on HN ]
Re:Ack - better than grep, a power search tool for programmers
by sparky on Thursday December 03, 2009 @08:22PM
(#975599)
Create a .ackrc file in your home directory. For you, it will contain:
--type-set
objj=.j
I found this on the ack-grep man-page in Ubuntu. You can set the ACKRC environment variable to give it a different directory (besides ~) to search for your .ackrc. Each line of the .ackrc is a command-line arg that will be prepended to any specified arguments every time you run ack-grep. If you don't want those arguments for a particular query, pass the --noenv flag to ignore the .ackrc. HTH!
Re:Ack - better than grep, a power search tool for programmers
by frig on Friday December 04, 2009 @09:43AM
(#976394)
Just something I had a hard time figuring out and seems poorly documented:
--type-set=scala=.scala # works in .ackrc
--type-set scala=.scala # doesn't work in .ackrc
...despite the version with one equals being correct command-line sequence. Only seems to matter if you want each flag on a single line in your .ackrc file. Might not be true for everyone.