nanozuki/tabby.nvim

Add buffer filter

EpsilonKu opened this issue · 6 comments

Bufferline.nvim (docs) has filter option. Also it filter when you navigate between buffers (because of custom :BufferLineCycleNext command).
I know it's easy to make it. But I think it will really useful to make ready custom command and filter. I personally use it for nvim-dap (it create repl as buffer).

Sorry for the delay in my response due to the holidays. I think this feature is very useful just I haven't figured out a way to implement it yet. Thanks for the other plugins you provided for my reference.

I will reply to this issue on the progress of developing this feature.

In the current case, you can also use normal lua code to filter. Just return the empty string in the callback of line.wins().foreach({callback}) and the label of the win will not be rendered.

I want to add filters in line.wins({filters}).foreach({callback}), for example:

Users can define customer filters, receive win object return boolean:

function not_nvimtree(win)
  return not string.find(win.name(), "NvimTree")
end
line.wins(not_nvimtree).foreach(function
...
end)

And provide some built-in filters.

What do you think about it?

Yeah, sounds really cool. Better than bufferline.nvim.

I'm wondering if such buffer filtering would allow to keep separate sets of buffers per tab, like it's possible with vim-ctrlspace. I do not use splits, only set of buffers in each tab. I always see just one buffer in a tab, but I can easily cycle thru the tab's buffers.

@EpsilonKu I complete this feature now. You can check the doc in tabby.line.wins().foreach(). Welcome to feedback on this issue!

@ajtakrajta
This filter feature only changes the display in the tabline. Won't change the behavior in opening a buffer. Maybe you can add a custom command or something else to do this.