I know Vim provides functions to display window's dimensions. But does it also provide ways for me to know current buffer/split's dimensions? Like how many lines and columns in displable area?
Currently all I can find online is the information on how to change the split width and height rather than obtaining the current dimension. But I don't need to change the split size, only need to know its size information to organize some material in the buffer.
Edit: As indicated by @Tommy A in his comment, the reason I have this question is that I misunderstood of the terminology. To quote him:
A window is a viewport for a buffer. "Split" is just a verb in Vim. I think you might be mixing up the terminology for windows and buffers. Soft wrapping occurs at winwidth(0) and it's also the the total number of characters that can be displayed horizontally. Hard wrapping occurs at &textwidth.
Hence what I want to do is to show the window dimension, by winwidth(0)
and
winheight(0)
.
Also, as mentioned in Question Get Usable Window Width in Vim
Script,
winwidth(0)
is usually larger than the usable width of the window for the
content. To obtain the correct size information, please refer to the answer in
that question.