Markus
Markus

Reputation: 735

How do I get the width of the tabline in Vim script?

I'm currently using winwidth(0) to find out how much text I can display in the tabline but this doesn't work if there are vertically split windows and the current window doesn't span the full width of the top frame. How do I get the width of the top frame or the tabline in Vim script?

Upvotes: 3

Views: 314

Answers (1)

romainl
romainl

Reputation: 196566

The tabline takes all of the available width. The columns option gives you that width:

let tabline_width = &columns

Upvotes: 6

Related Questions