DEV Community

Discussion on: Using buffers, windows, and tabs efficiently in Vim

Collapse
 
gurdeepgss profile image
thicckWire • Edited

Is there any way we can have buffers containerized in tabs.

I mean suppose I open 3 buffers in vim.
then I create a new tab and open 3 completely new buffers in that tab.
Now if I :ls it shows all the buffers, the behaviour that I expect or think-of-as-better-one is that if I :ls in second tab, only buffers opened in that tab are shown.
And first tab buffers are only shown for the first tab on :ls.

Though it should be configurable, if one want to access buffers from the first tab then some variant of :ls or some other command should give me all the buffers so that I can use vim's default behaviour.

what do you guys think of it?
Should it be this way, as I described or should this be left to tmux+new-vim-instance?

Collapse
 
iggredible profile image
Igor Irianto

I never thought of containerizing buffer in tabs before, but that's a good point. I personally don't use Vim tabs. I may have multiple Vim instances in different Tmux windows, so they are automatically containerized.

I think it comes down to a design decision. The people who wrote Vim (Bram etc) probably decided that buffers are shared objects instead of tab-specific objects. It could've gone either way haha.

Again, this is a really good point that you brought up!

Collapse
 
konfekt profile image
konfekt

vim-ctrlspace is a plug-in to containerize buffers in tabs.

Thread Thread
 
gurdeepgss profile image
thicckWire

Will look into that.

Collapse
 
gurdeepgss profile image
thicckWire

from a users perspective I think this should be configurable, for the folks who do not have tmux available (like I on my employer's windows machine).

Or I think we could make a plugin that does this somehow. I don't know the details of it, but I think it might be possible.