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

Is it possible to group search result by filename? #115

Open
bashonregardless opened this issue Jun 23, 2023 · 7 comments
Open

Is it possible to group search result by filename? #115

bashonregardless opened this issue Jun 23, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@bashonregardless
Copy link

Feature description

By default, Neovim displays all search results in a flat list in the quickfix window, can you group the results by files?

For example, if there are more than one search result in a file, it should be categorised under that filename.

Describe the solution you'd like

Group the results by files

Additional context

No response

@bashonregardless bashonregardless added the enhancement New feature or request label Jun 23, 2023
@rockyzhang24
Copy link
Contributor

rockyzhang24 commented Jul 12, 2023

Probably you could use zf to filter out the results you don't need. Maybe you could check trouble.nvim that supports the filename grouping.

@ashfinal
Copy link

@bashonregardless You can use this plugin qfview.nvim, which has filename grouping and smart common prefix truncating functions. I actually wrote this recently. 😄

@ikimmit
Copy link

ikimmit commented Feb 20, 2024

Trouble has a very beautiful, clean way of presenting the matches under each file. That being said, nvim-bqf has so many great features that I cannot find in Trouble, it would be perfect to have some file grouping within nvim-bqf.

@kevinhwang91
Copy link
Owner

Trouble has a very beautiful, clean way of presenting the matches under each file. That being said, nvim-bqf has so many great features that I cannot find in Trouble, it would be perfect to have some file grouping within nvim-bqf.

  1. The UI in qf is controlled by quickfixtextfunc, dressing up a new UI can't make everyone thumb up;
  2. The items in qf list are created by the source, and group items by bqf is hacked;

Maybe a new feature with an option is a good way to do this, but I am not planning to do this, need volunteers.

@ikimmit
Copy link

ikimmit commented Feb 20, 2024

@kevinhwang91 thanks for replying!

I cannot promise to do it but would like to give it a try, would be a nice way to learn neovim programming. If you have some tips or pointers that could speed me up they would be most welcome!

@kevinhwang91
Copy link
Owner

@kevinhwang91 thanks for replying!

I cannot promise to do it but would like to give it a try, would be a nice way to learn neovim programming. If you have some tips or pointers that could speed me up they would be most welcome!

  1. Inspect the qftf:
    https://github.com/kevinhwang91/nvim-bqf/tree/654c904d5ad9dc4846445056086168e25bd8ba2d?tab=readme-ov-file#format-new-quickfix

  2. Debug enable function in main.lua;

  3. Understand QfSession and QfList object to get items in list;

  4. Add an option in config.lua;

@kqvanity
Copy link

kqvanity commented May 1, 2024

@ashfinal What do you exactly mean by filename grouping? It only aligns the file listing at my setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants