ggreer/the_silver_searcher — pull request #438 by hwgao (2014-06-23 08:21:23+00:00)
Title: Let search in a file following the option --[no]heading. As if searching ...

I don't find ag has the option to search in a file and print filename and line number in the font of each result.
So I made this change to let searching in a file follow the option --[no]heading. As if searching vim with Ag.vim or Ack.vim if just searching in the current file the file name and line number are needed to go to the search result. With this change "Ag --nogroup foo %" can be used.

This is not the best solution. Or an option -H same with ack should be added.