Neovim: Seting floating windows sizes without impactig standard windows sizes

Hi. I’ve been using vim for quite some time with a trick shown in an upcase tutorial.

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

This offers an elegant way to split your windows.

I’m now setting up neovim and coc.nvim . My issue is that floating windows that appear thanks to coc.nvim take the full height of the window.

I would like those floating windows to take only as much height as they need.
Is there a way to set boundaries to floating windows dimensions without altering the dimensions of standard windows ?


Hi, I just stumbled on the same issue and finally managed to solve it using:

set winheight=5
set winminheight=5
autocmd WinEnter * wincmd _

this maximizes the horizontal split when entering the window while respecting the winminheight. you could also do e.g.

set winwidth=80
set winminwidth=80
autocmd WinEnter * wincmd |

which does the same for vsplit, but it doesn’t behave exactly as I’d want since it maximizes the window even when not necessary. it would be nice if there was sth like winmaxwidth.