winwidth(0)
returns the width of the current window. However, if vim has multiple vertical splits, forming multiple windows, winwidth(0)
would only return the width of the current window.
For example, let say the terminal has 80 columns across. Without, any vertical splits, echo winwidth(0)
would return 80. If <C-W>v
is used however, echo winwidth(0)
would return a smaller number, less than 80, equal to the width of one of the split windows.
How can I get the full terminal width without forcing the cursor to jump through all vertical splits (for example, with windcmd l
)?