-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Plans for limiting search to file types? #128
Comments
This would be most welcome! This morning I started an experiment - replacing # ~/.ackrc
--type-add=ruby=.haml,.rake,.builder
--type-add=html=.erb,.haml,.slim
--type-add=css=.scss,.sass,.less
--type-set=sass=.scss,.sass Allowing for |
While using Ack, I thought I was using the file type switch simply to speed things up, now that I'm using ag I find I need it to narrow results. Even if those results are returned much faster. |
I never used this feature in Ack, which is why I didn't write it in Ag. I'd like for it to exist, but I'm not sure of the best way to go about it yet. Adding search by file-type would be a pretty big change. While Ag has plenty of code for blacklisting/ignoring, it doesn't have much whitelisting. I'll give this problem some more thought. One more thing: I'm going on vacation for the next couple of weeks. I doubt I'll be online much. |
That's certainly fair. I wish I could be of more help with implementing a feature like this, but it's been a long time since I last flexed by Have a great holiday! |
For now, I'm using bash globbing with ag, which I presume is going to be much slower. E.g:
|
Yeah this is sort of a deal breaker for me. When you said "replacement" for grep & ack but no mention of file types... (I had to really search for this issue), I wouldn't say it's a replacement, definitely a fast alternative though. |
For basic extension-based type stuff, I've been using aliases with -G, personally. E.g.:
Not ideal, but it gets the job done for now, until ag gets better file type support. |
I agree I've got many customs file types in my |
+1, this feature is essential when dealing with larger codebases. |
Looks like #283 has implemented this. |
Perhaps someone who know how it work could document this feature in the README, or perhaps in the Wiki? |
Good shout @brondsem! @stevenharman I've just upgraded my version of
To search for |
I'm on it |
Docs here: #327 Kevin Burke | Twilio On Tue, Jan 21, 2014 at 5:26 PM, Beau notifications@github.com wrote:
|
This is great. Only thing is I can't find a method to add your own mapping ? E.g search only logs |
Is there a way to print the list of filetypes? I know that we can view the source to see the list in the |
I could have a look at listing the file types this evening if I get a chance. Should be quite a simple patch. |
Have a look at PR #332 and tell me what you think. |
This issue seems closable in light of #283. |
Oh yeah, totally implemented. |
|
Similar to ack, e.g. limit to Ruby files:
ag "layout" --rb
The text was updated successfully, but these errors were encountered: