One undocumented trick is to use %{MyFunc()}
expression in the statusline syntax. MyFunc()
is always called whenever something happens so you can check the window size in it.
For example, You can see the window height/width in the statusline.
function! EchoWinSize()
return winheight(0) . '/' . winwidth(0)
endfunction
let &statusline = "%{EchoWinSize()}"
As well as the statusline, guitablabel, iconstring, rulerformat, tabline, titlestring options support the statusline syntax.
However, I am not sure about its negative side effect.
I found this trick since
I have been looking for something like a WindowScrolled event,
but not yet implemented.
In my plugin, I am thinking to use iconstring, which seems not to be used so common, to check the window scroll.