[Enhancement] Show only buffers not open in windows
Closed this issue · 9 comments
It would be nice if the list of buffers was the set of all buffers minus the list of all buffers open in a window plus this windows buffer.
example:
A vim session with the following windows and tabs:
- one window, with file A
- vsplit file B and C
Not in a window: buffers D and E
I would then expect:
- the window with A to show: A D E
- the window with B to show: B D E
- the window with C to show: C D E
Does that make sense?
this type of thing would only be possible for the statusline implementation, as there is only a global command bar. i'm also curious how this will improve your workflow, because i don't really see it yet 😕
My normal work flow is to have multiple tab. Each split between code & unit tests. E.g. A tab might have foo.rb and foo_spec.rb.
In addition I have files that I use for references. Those files aren't represented anyplace ( eg via tab names).
@bling Alas, that didn't work.
I had two tabs with a single pain each: M and S
My bufferline for the M tab shows: M, M_spec, S_spec, and S
I expected to see: M, M_spec, S_spec
I'm not sure this is the right solution. I feel a need for something but I'm not sure what.
Perhaps a friendlier tab completer for :b <tab>
? I use kien/ctrlp.vim but that's overkill... though maybe there is a way to tweak it to be simpler.
Here's my attempt at describing my "scratch" again:
- I want a list of buffers not being shown in a window.
- An alternative would be a complete list of buffers with ones visible in a window would be greyed out or otherwise marked.
- I should be able to switch to one of these buffers easily (e.g.
:b3
would be easy. So would a ctrlp like list). - The list doesn't have to be always visible; but must be easy to invoke.
hmmmm, the function i was using only dealt with the current tab, not all tabs. i could modify it to include all tabs, but sounds like there might be a better solution for you.
i have this little binding in my vimrc:
nnoremap gb :ls<cr>:e #
it doesn't do any filtering of course, but the list vim prints has all the info you need, and you're just a 3<cr>
away from selecting another buffer.
Cool!
Why do you use :e #
instead of :b
? Is there an advantage to one approach over another?
I'll take at look at your commit and see if I can make it filter the way I want.
Thanks!
i forgot where i copy/pasted it from...but looks like :e #3
is the same as :b 3
. see :help tabpagebuflist
; it has an example of how to query all buffers in all tabs.
@docwhat where did we leave with this? should we fix up the algorithm to deal with all tabs? if you don't think that even doing that would resolve your workflow i'd prefer to just remove this option altogether. let me know. thanks!
Go ahead and remove it. Worse case I can resurrect it.