Making sure splits are a decent size when a new one is opened

15 views
Skip to first unread message

Some Developer

unread,
Dec 9, 2012, 9:41:25 AM12/9/12
to vim...@googlegroups.com
Is it possible to set the default size of a split when it is opened? I
use the Vim man page plug-in that allows you to use <Leader>+K to open
the man page for the word under the cursor but it opens in a split that
is tiny and also resizes any other open splits which means I need to
resize them every time I try and open a man page.

It would be nice if I could make the size of the man page split a
certain size and then scale the other open splits accordingly.
Unfortunately I have no idea if this is possible.

Tim Chase

unread,
Dec 9, 2012, 2:23:37 PM12/9/12
to vim...@googlegroups.com, Some Developer
It sounds like you want to mess with the following options:

:help 'winminwidth'
:h 'winminheight'
:h 'winwidth'
:h 'winheight'

which can be done on a vim-wide basis, or you can use an :autocmd to
set them for particular buffer-types when they're opened.

-tim



Tony Mechelynck

unread,
Dec 9, 2012, 4:29:00 PM12/9/12
to vim...@googlegroups.com
Yes, and the following are also relevant:

:help 'equalalways'
(boolean) to make split-windows as close to equal as possible

:help 'eadirection'
(string) to decide whether 'equalalways' applies to horizontal splits,
vertical splits, or both.


Best regards,
Tony.
--
A reactionary is a man whose political opinions always manage to keep
up with yesterday.

Some Developer

unread,
Dec 15, 2012, 9:53:26 AM12/15/12
to vim...@googlegroups.com
I'm pretty new to Vim so I'm having a couple of issues with this. I'm
not entirely sure how to find out the type of a buffer. For instance I
have the clang complete plug-in installed which opens a quick fix window
when it detects an error is any C or C++ code. I'd like to set the
minimum height for this buffer but I don't know how to find out how to
reference that particular buffer and only that buffer.

The options that you have both listed above are exactly what I am after
it is just the bit of a problem when using :autocmd.

Sorry for the newbie question but I've done very little in the way of
Vim scripting so I'm at a loss. Are there any helpful resources for this
kind of information?
Reply all
Reply to author
Forward
0 new messages