Wednesday, October 19, 2011

Re: winwidth & winheight doesn't work here

> On Mon, Oct 17, 2011 at 02:58:44PM +0200, Tony Mechelynck wrote:
>On 15/10/11 13:23, Roger wrote:
>>> On Sun, Oct 09, 2011 at 11:37:56PM +0200, Tony Mechelynck wrote:
>>> On 09/10/11 11:08, Roger wrote:
>>>> Reading the good book Learning the VIM Editor(s) and see winwidth& winheight
>>>> mentioned, but am having trouble getting it working here!
>>>>
>>>> Why, when settings winwidth on vertical split files, it's not automagically
>>>> resizing the windows as I toggle between the files?
>>>>
>>>> I have set to noequalalways, also. :-/
>>>>
>>>
>>> With me it does, but remember that these options are "desired minimums
>>> for the current window" and that the "absolute minimums for any window"
>>> are set by 'winminwidth' and 'winminheight'. When switching windows, the
>>> new window will not be resized if it already exceeds the desired
>>> minimum, nor will it be made bigger than would allow all other windows
>>> to remain at or above the absolute minimum.
>>>
>>> Also, some special window types have their own desired minimums: see
>>> :help 'helpheight'
>>> :help 'cmdwinheight'
>>> :help 'previewheight'
>>>
>>> The absolute minimums may be set to zero, the desired minimum for the
>>> current window must be at least 1 since the currentcursor location must
>>> always be visible.
>>>
>>> The following should swell the current window to maximum size, squashing
>>> other windows to only a vertical divider on left and right or a status
>>> line above and below:
>>>
>>> :set nowfh " no fixed size
>>> :set noea eadirection=both " no equal size
>>> :set wmw=0 wmh=0 " squash other windows
>>> :set wiw=9999 wh=999 hh=999 cwh=999 pvh=999 " enlarge current window
>>> :let netrw_winsize = 100 " netrw split to 100% size
>>
>>
>> For GVIM:
>>
>> nowfh was already default here.
>>
>> was ea, but I set to noea.
>>
>> eadirection=both was default too.
>>
>> set wmw& wmh is set to default 1?
>>
>>
>> Now the culprit was your wiw, wh, hh, cwh, pvh values!
>>
>> My default values were set to something like these:
>>
>> winwidth=1
>> winheight=1
>> helpheight=20
>> cmdwinheight=7
>> previewheight=12
>>
>> And, once I used your wiw, wh, hh, cwh, pvh values, changing focus of the
>> windowns and window resizing automagically happens now!
>>
>> The O'Reilly Learning VIM mentioned something about these values, but gave no
>> real set values for a reader to try on his/her own VIM session. With your
>> values, I'm now rolling on customizing to my liking!
>>
>> Next, I should be able to do this with CLI VIM(?).
>>
>> -- Roger
>> http://rogerx.freeshell.org/
>>
>
>The snippet I proposed above should work equally well in console mode as is
>does in GUI mode...

It does and things are working well now. However I can see why VIM doesn't
have this feature on by default.

If you want to compare to files side by side (not using vimdiff), then one
needs to do some further hacking to get the windows back to equal size.

And just setting ":set noequalalways" doesn't magically resize the windows.
And if one manually resizes one window until both are back to equal size,
changing focus (ctrl+w+W) again reverts to the focused window taking full
screen size.

So, my next task is to hot-key a function key to "make windows equal".

But then when I get to this point, I ask myself why not just use tabs?

What joy. ;-)

Well, I can see where the idea of tabs likely originated!


>-- Don't believe everything you hear or anything you say.

--
Roger
http://rogerx.freeshell.org/

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