Changing buffer behaviour

2006-09-25 Thread Fabien Meghazi

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.

Regards.

--
Fabien Meghazi

Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]


Re: Changing buffer behaviour

2006-09-25 Thread Yakov Lerner

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


Re: Changing buffer behaviour

2006-09-25 Thread Fabien Meghazi

Does this do what you wanted ?


Well actually it's not the solution I'm searching for as it won't work
when I type vim *.py from a terminal


Re: Changing buffer behaviour

2006-09-25 Thread Yakov Lerner

On 9/25/06, Fabien Meghazi [EMAIL PROTECTED] wrote:

 Does this do what you wanted ?

Well actually it's not the solution I'm searching for as it won't work
when I type vim *.py from a terminal


Try 'vim -p *.py', or

   alias vim='vim -p'

(depending on your shell)

Yakov


Re: Changing buffer behaviour

2006-09-25 Thread Fabien Meghazi

Try 'vim -p *.py', or

alias vim='vim -p'


Thanks ! I didn't knew about this switch