In fact, I just want to write a script to toggle preview
window. But it seems can't archived from any internal setting of vim.
So, as title. I want to write a script to do it. Any one knows how to check preview
window is opened(or existed)?
Check variable previewwindow
or pvw
(please refer to the link). A sample code would be:
fun! previewWindowOpened
for nr in range(1, winnr('$'))
if getwinvar(nr, "&pvw") == 1
" found a preview
return 1
endif
endfor
return 0
endfun
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With