Vimrc: winminwidth "E36 Not enough room" error

I’m having problems setting a ‘dynamic’ window width in my .vimrc. Doing this for winheight works just fine (thanks to the Thoughtbot Art of Vim video for the starting point). Here’s the code:

" dynamic current window sizing from TBot Art of Vim
set winheight=9
set winminheight=9
let &winheight = &lines - 9
set winwidth=40
set winminwidth=40       " E36 Not enough room here
let &winwidth = &columns - 40

The winheight settings work just great; but the winwidth settings get the error.

However, it all works once I’m in vim; I usually have 3-7 related windows open in a single tab and the dynamic resizing means I always have lots of space horizontally and vertically to work in.

UPDATE
I learned that I can avoid the error message by pre-pending :silent! in front of the command. Cool

1 Like

Love that you update your questions when you find solutions.

1 Like

Also: that is an awesome fix for that annoying error. I had no idea you could use silent in cases like setting buffer parameters.

This is great, I’ve been fighting with this little annoyance for months now, super happy to get it cleared up!