Sunday, February 28, 2010

Re: Split window automatically when opening 2 or 3 files

On 03/01/10 21:39, Gary Johnson wrote:
> On 2009-12-31, Brock Henry wrote:
>> Hi,
>>
>> I want to have Vim (on Windows), automatically split the window if I open two
>> files (using right-click explorer integration - Open in Single VIM Window).
>>
>> Actually, a new right-click integration that did this (Open in split VIM
>> Window), would be perfect.
>>
>> Is there anyway to do this?
>
> I don't have a Windows machine handy at the moment so I can't test
> this, but it seems to me that you should be able to test in your
> _vimrc for the presence of more than one file name in the argument
> list with the argc() function, then if the number of arguments is
> greater than 1, execute ":all". See
>
> :help argc()
> :help :all
>
> HTH,
> Gary
>
>

Note that if you set 'winheight' to a high value in your vimrc in order
to make window sizes change dynamically (and the current window always
be the biggest one), you must use ":all" _before_ setting 'winheight',
otherwise it won't work.


Best regards,
Tony.
--
It is generally agreed that "Hello" is an appropriate greeting because
if you entered a room and said "Goodbye," it could confuse a lot of
people.
-- Dolph Sharp, "I'm O.K., You're Not So Hot"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: