vimtricks.wiki Concise Vim tricks, one at a time.

How do I open all loaded buffers into split windows at once?

Answer

:sball

Explanation

The :sball command (short for split all) opens every loaded buffer in its own horizontal split window in one shot. It is the quickest way to go from a single-window session to a tiled view of all the files you have open.

How it works

  • :sball splits the current window and opens each loaded buffer in a new split, stacking them horizontally
  • Only loaded buffers are shown — buffers that have been opened but unloaded (e.g. after :bwipeout) are skipped
  • Combine with <C-w>= afterwards to equalize all the split heights

Example

You have three files open in buffers 1–3:

:ls
  1  %a   src/main.go
  2   a   src/utils.go
  3   a   README.md

Running :sball results in three horizontal splits, one per buffer:

+------------------+
|   src/main.go    |
+------------------+
|   src/utils.go   |
+------------------+
|    README.md     |
+------------------+

Tips

  • :vert sball opens all buffers in vertical splits instead
  • :tab sball opens each buffer in its own tab page
  • Follow up with <C-w>= to equalize window sizes after :sball
  • :only (or <C-w>o) collapses back to a single window when you are done comparing

Next

How do I rename a variable across all its case variants (camelCase, snake_case, SCREAMING_CASE) in one command?