9

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.

1

2 Answers 2

9

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...

2
  • I agree. I prefer working with buffers as well. For more information why to use buffers for tabs take a look at this vimcasts by Drew Neil: vimcasts.org/episodes/how-to-use-tabs Feb 7, 2013 at 17:47
  • Thanks! That's similar to the approach I write about above, except slightly simpler with the piping. Do you know if it's possible to do a recursive args/arga, so you can do: :cd directory :arga * | tab sball ?
    – miyalys
    Feb 8, 2013 at 9:12
5

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.

Your Answer

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

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