rking / ag.vim

Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'
1.74k stars 131 forks source link

Ignore filetypes #138

Closed garand closed 8 years ago

garand commented 8 years ago

If this is already possible and I missed something, please let me know.

I would like to search the project for a string but exclude a certain filetype. For instance, this morning I was searching a codebase for a string and wanted to find where it was in the markup (PHP file in this case). When I searched though, I get tons of results for where it was in many different CSS files and that clogged up my results with stuff I didn't care about. If I could have set something to ignore any .css/.scss file that would have been amazing. Or even just search *.php files.

What do you think?

losingkeys commented 8 years ago

You can pass options to ag through ag.vim. Ag supports searching by filetype. So for example you could run (from within vim) :Ag --php "search query". Unfortunately ag does not have irons for searching everything but a specific filetype. You could open an issue with ag for that though. On Apr 6, 2016 10:19 AM, "Anthony Garand" notifications@github.com wrote:

If this is already possible and I missed something, please let me know.

I would like to search the project for a string but exclude a certain filetype. For instance, this morning I was searching a codebase for a string and wanted to find where it was in the markup (PHP file in this case). When I searched though, I get tons of results for where it was in many different CSS files and that clogged up my results with stuff I didn't care about. If I could have set something to ignore any .css/.scss file that would have been amazing. Or even just search *.php files.

What do you think?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/rking/ag.vim/issues/138

garand commented 8 years ago

Great, thanks!