Vim: Show the index of tabs in the tabline

Posted by bitmask on Super User See other posts from Super User or by bitmask
Published on 2011-09-02T21:27:42Z Indexed on 2013/07/02 5:08 UTC
Read the original article Hit count: 489

Filed under:
|
|

Lets say I opened file1.txt, file2.txt, file3a.txt and file3b.txt such that the tabline (the thing on the top) looks like this:

file1.txt  file2.txt  2 file3a.txt

(Note how file3b.txt. is missing because it is shown in a split, in the same tab as file3a.txt)

To move more quickly between tabs (with <Number>gt), I would like each tab to display its index, along the filename. Like so:

1:<file1.txt>  2:<file2.txt>  3:<2 file3a.txt>

The formatting (the angle braces in particular) are optional; I just want the index to appear there (the 1:, 2: and so on).

No clues on :h tab-page-commands or google whatsoever.

© Super User or respective owner

Related posts about vim

Related posts about tabs