how do I get the current window width?

6 views
Skip to first unread message

skeept

unread,
Feb 11, 2012, 3:29:49 PM2/11/12
to vim_use
If I type
:set lines?

I get the width of the current terminal.
I would like to know if there is a way of getting the width of the
current window.

The reason I would like to do this is that I would like to set up my
statusline in such a way that
some information is only displayed if the width of the current window
is big enough.

Thanks.

Gary Johnson

unread,
Feb 11, 2012, 4:01:54 PM2/11/12
to vim_use

The full width of the Vim screen (or terminal screen) is in
'columns' and the width of the current window is given by
winwidth(0).

Regards,
Gary

skeept

unread,
Feb 11, 2012, 11:49:07 PM2/11/12
to vim_use
Thanks!
Reply all
Reply to author
Forward
0 new messages