On 9/25/06, Fabien Meghazi <[EMAIL PROTECTED]> wrote:
Hi all,

Remember this thread ?
http://tech.groups.yahoo.com/group/vim/message/71395


I had very usefull information from this list about my question.
The solution offered was to force the use of the command :e to open a new tab.
But I wonder if there's another solution because the following case is
not supported :

example from command line: vim *.py

or even :args *.py from vim

In this case, vim will open a buffer for each file as it always did.
But I would like it to open files in tabs.

My question is: is it possible to make vim open a new tab each time it
have to open a new buffer (maybe with autocmd) ?  If yes, I guess it
would be a clean solution for my problem.

Does this do what you wanted ?

cabbrev args <c-R>=(getcmdtype()==':' && getcmdpos()==1 ? "TABARG" : "args")<cr>
:command! -nargs=+ TABARG :call MultiTabs(<f-args>)
function! MultiTabs(...)
   let k =1
   while k <= a:0
       exe ':tabnew '.a:{k}
       let k = k + 1
   endw
endfun

It remaps :args to open one tab per filename.

Yakov

Reply via email to