Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: Tabe multiple files?

Tags:

vim

tabs

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.

like image 950
miyalys Avatar asked Feb 07 '13 16:02

miyalys


2 Answers

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

like image 105
Kent Avatar answered Nov 07 '22 00:11

Kent


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.

like image 26
miyalys Avatar answered Nov 07 '22 00:11

miyalys