Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

in vim, I can one file en a new tab with :

:tabnew file

If I have many files, example: util.h and util.cpp.

how I can open the files in new tabs ?
similar to

:tabnew util.*
share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

First, add the files as arguments:

:argadd util.*

Then use the :argdo command with :tabnew:

:argdo tabnew

You could do this with :bufadd and :bufdo but none of the buffer commands can add multiple files at the same time. Also, using the :argadd method may avoid opening tabs for files you already have open—it depends on whether you invoked Vim with multiple file arguments, or whether you have already been using the :arg* commands. (You could always do :argdel * first.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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