1

How can I split view all buffers in vim with a distribution between vertical and horizontal? Is there a plugin?

I know how to make all buffers appear in either horizontal or vertical splits:

:ball
:vertical ball

But I want several to be vertical first, then, once a reasonable number have displayed, start creating a 2nd row below it: so a horizontal split. Then, continue the process so we end with tiled windows. Maybe if there are 7 buffers:

|| x | x | x ||
|| x | x | x ||
||     x     ||

Use Case

Let's say I want to use bufdo on all my buffers. I'd like to see the changes they are making as much as feasible. Even on a small screen, I could make 4 vertical splits above 4 horizontal ones, and see a little bit of each file. More than 9 buffers, and it's probably too small to read, so maybe there could be a vimrc-changeable setting for user preference of max number of splits, and/or perhaps some influence based on screen resolution or display width ability.

Beginning of an answer

Based on the answer here, I'm tempted start macro'ing that, and I can see that temptation turning into writing my first plugin. I just feel like surely this is a common enough desire to already have an existing plugin or solution.

3
  • The question is not clear to me- what kind of layout are you trying to achieve? What do you man by "equal distribution vertical horizontal?"
    – Mass
    Apr 24, 2022 at 15:48
  • Updated question for clarity. Apologies, I'm still not sure if it's clear, lmk.
    – Polo
    Apr 24, 2022 at 16:13
  • Interesting question. You might be able to "watch" the changes if you disable lazyredraw; otherwise I recommend investigating them with another tool, like git diff or :help DiffOrig
    – D. Ben Knoble
    Apr 26, 2022 at 13:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.