Why can't vim handle .vimrc if winheight is not set twice?

I use the following options to make the split, which I focus on the largest on the screen. When switching between partitions, the window sizes are updated accordingly:

set winwidth=84
set winheight=5
set winminheight=5
set winheight=999

This works fine, however you see that there are two definitions winheight, which is odd. I deleted the first ad winheightto make sure everything works the same. Unfortunately, vim throws an error that it cannot process my .vimrc file.

So, to clarify the situation, I stole this configuration from someone .vimrc. There must be a reason why these options should be set twice, but I could not find anything useful in the help.

Do you know why vim throws an error in this case?

+4
source share
1 answer

If you get an error E591:

E591: 'winheight' cannot be smaller than 'winminheight': winminheight=5

the problem may just be ordered. The default winheightis 1. Without the first parameter, winheightyou are trying to set winminheightmore than the current one winheight, which obviously causes problems (and leads to an error).

I think that a duplicate declaration is also just a matter of order. Attempting to start Vim with the help winheight=999moved up before installation winminheightgives me an alternative error

E36: Not enough room

Thus, if you want to set max winheight winheight( 999) and set winminheightto something more reasonable than its default value ( 1), this may be the only workable approach.

+3

Source: https://habr.com/ru/post/1531243/


All Articles