miyalys
miyalys

Reputation: 440

Vim: Tabe multiple files?

I know about running

vim -p file1 file2 file3

But is there away to do something similar from within vim? What I've thought about wanting to do is

:tabe file1 file2 file3

or (IMO worse, but still an improvement):

:edit file1 file2 file3

...but neither of those are possible, by default at least.

Upvotes: 9

Views: 1113

Answers (2)

Kent
Kent

Reputation: 195059

try this:

:args file1 file2 file3 |tab sall

this will only put newly opened file (file1, file2, file3) in tabs, not all buffers.

if you want to open all buffers in tabs, replace sall to sball

btw, is tab convenient to work with? personally I like working with buffer more...

Upvotes: 9

miyalys
miyalys

Reputation: 440

Upon browsing the web more extensively, researching in regards to this question, the best solution I've found so far is:

:arga file1 file2 file3 (...)

Which will create buffers for all the input files. Then follow that by:

:tab sball

Which will open all the buffers into separate tabs. But maybe there's an even better/shorter way? If not maybe I'm helping someone else out there, having the same problem/question.

Upvotes: 5

Related Questions