Skip to content
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

Add grouping by file to "live_grep" picker #2297

Open
andyrichardson opened this issue Jan 1, 2023 · 4 comments · May be fixed by #2771
Open

Add grouping by file to "live_grep" picker #2297

andyrichardson opened this issue Jan 1, 2023 · 4 comments · May be fixed by #2771
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@andyrichardson
Copy link

Hi there, huge thanks for all your work on this project!

Is your feature request related to a problem? Please describe.

I'd love to see grouping of results when using live_grep. This would come with a few advantages

  • remove noise of repeating file names
  • make it easier to distinguish files "at a glance"
  • create more horizontal space for grep results
Example in VS Code Screenshot 2023-01-01 at 22 04 20

Describe the solution you'd like

An option to display results, grouped by file.

When enabled:
For each file containing a match, a heading is displayed. The heading cannot be selected/highlighted and only functions as an annotation. For each result, the position of the match, along with the highlighted matched string is shown.

Before

Screenshot 2023-01-01 at 21 59 43

After

Screenshot 2023-01-01 at 22 00 04

@andyrichardson andyrichardson added the enhancement Enhancement to performance, inner workings or existent features label Jan 1, 2023
@ivanbrennan
Copy link

I think this would be a great enhancement for "live_grep" and "grep_string".

That style of grouping results is also used to great effect, for example, by the vertico emacs package:

image

@otavioschwanck
Copy link

would be so awesome

@jamestrew
Copy link
Contributor

I think this extension has something like it https://github.com/fdschmidt93/telescope-egrepify.nvim

I also think it'd be easier to make a new picker than to augment live_grep like it's been done with egrepify and live-grep-args. But I don't think there's any interest between the maintainers to add more builtin pickers.

@otavioschwanck
Copy link

otavioschwanck commented Oct 1, 2023

I think this extension has something like it https://github.com/fdschmidt93/telescope-egrepify.nvim

I also think it'd be easier to make a new picker than to augment live_grep like it's been done with egrepify and live-grep-args. But I don't think there's any interest between the maintainers to add more builtin pickers.

tested this extension, its like that, but i think this extension is still buggy

EDIT:

egrepify fixed all bugs that i pointed and now its super awesome, should be telescope default (+1 for egrepify)

@griwes griwes linked a pull request Nov 7, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants