snacks.nvim icon indicating copy to clipboard operation
snacks.nvim copied to clipboard

feature(picker): allow `Snacks.picker.grep` `buffers` option to be a list of buffer numbers

Open mehalter opened this issue 8 months ago • 5 comments

Did you check the docs?

  • [x] I have read all the snacks.nvim docs

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

Sometimes I only want to grep for words within a specific set of buffers. It is nice that the option currently lets me say I only want to search open buffers with buffers = true, but it would be very nice if that value could also be an integer|integer[] in which I could specify a single buffer or a list of buffers to search within.

Describe the solution you'd like

Allow buffers to be an integer|integer[]|boolean? in which boolean true/false operates the same as it does currently, an integer searches just that single buffer, and integer[] specifies a list of buffers to search.

Describe alternatives you've considered

Not sure if there are other solutions or ways to do this with Snacks.picker

Additional context

No response

mehalter avatar Mar 27 '25 16:03 mehalter

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 27 '25 02:04 github-actions[bot]

Not stale

mehalter avatar Apr 27 '25 02:04 mehalter

You can pass into grep something like dirs = { vim.api.nvim_buf_get_name(buf) } to search within that specific buffer. Maybe you can implement a logic to populate opts.dirs according to what you want?

Not 100% sure if that's what you really want.

dpetka2001 avatar Apr 27 '25 09:04 dpetka2001

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 28 '25 02:05 github-actions[bot]

This isn't stale

mehalter avatar May 28 '25 02:05 mehalter

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 28 '25 02:06 github-actions[bot]

Not stale

mehalter avatar Jun 28 '25 02:06 mehalter

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 30 '25 02:07 github-actions[bot]

not stale

mehalter avatar Jul 30 '25 02:07 mehalter

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 01 '25 02:09 github-actions[bot]

Not stale

mehalter avatar Sep 01 '25 02:09 mehalter

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Oct 03 '25 02:10 github-actions[bot]

Not stale

mehalter avatar Oct 03 '25 02:10 mehalter

Like @dpetka2001 mentions, you can already achieve this by passing the buf names to the dirs option

folke avatar Oct 20 '25 15:10 folke