I’m looking for a way to preview the results of a grep search within files as well as fold the output when there are multiple matches in the same file.

helm-projectile-ag is my current grepping tool but doesn’t seem to offer such a facility, unless I haven’t read the docs well enough.

My issues are:

  1. It can present a lot of hits in the same file it but lists each one separately. A good option would be to fold the output when there are multiple matches, then I can use the Tab keep to expand the fold and scan through the previews and even edit them right away.

  2. The search panel is modal. It doesn’t create a result buffer which you can save and then return to later to continue to select files to edit. Once you lose focus it is gone. It doesn’t even seem to retain the search term so you can use it later.

  3. It would be nice to have a window that shows the actual CLI command passed to the search utility. I see them once in a while but it would be good to show them up front or make them easily accessible.

Do any of the project grep tools or helm-projectile-ag itself offer such features?

  • shryzr@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Try embark and the embark export along with consult (or maybe helm). With consult for example you can hit Tab to jump to the next file. Embark export can export the grep results, which can even be saved - and re-opened later and browsed with grep mode enabled :)