10

How do I easily open my current vim buffers/arguments in a separate window/tab each?

I know about:

$ vim one.txt two.txt three.txt -O

However if I simply start vim with:

$ vim one.txt two.txt three.txt

How can I replicate this behaviour once I've already started vim?

19

To split all buffers use :sba or :vert sba

| improve this answer | |
3

Vim command :sba has also a shortcut: :ba.

:[N]ba[ll] [N] :[N]sba[ll] [N] Rearrange the screen to open one window for each buffer in the buffer list.

To back again to single tag, use: :on (:only).

:on[ly][!] Make the current window the only one on the screen. All other windows are closed.

To quit, use: :qa

See also: How to convert all windows into horizontal, vertical or tab splits? at Vim SE

| improve this answer | |
1

How to convert buffers to windows/tabs:

  • buffers > horizontal windows: :ba (buffer all)
  • buffers > vertical windows: :vert ba (vertical buffer all)
  • buffers > tabs: :tab ba (tab buffer all)

How to convert window/tabs to buffers:

  • windows > buffers: :on, :only (current window only)
  • tabs > buffers: :tabo, :tabonly (current tab only)

If you want to convert all windows to tabs, first convert windows to buffers, then buffers to tabs:

:on | tab ba

| improve this answer | |
1

Answering part of my own question:

How do I easily open my current vim buffers/arguments in a separate window/tab each?

:tab all
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.