Say I have a bunch of tabs open in Vim, with a tabline looks something like this:
1 v/file1.py 2 t/file.py 1 t/file.py 1 o/otherfile.py
See how two tabs both say "t/file.py"? Those are different files, they just get turned into the same tab label.
In my workflow the tab titles are often ambiguous (yay for Chef naming everything "default.rb") or unhelpful ("I know one of these 8 tabs with 4 buffers each has that file I'm looking for...").
I'd like to rename the tabs to indicate what they logically represent:
1 homepage_view 2 tests 1 homepage_template 1 o/otherfile.py
I'm fine with tabs defaulting to a filename-based label, as long as I'm free to change it once the tab is created.
How can I do this in Vim?
:help setting-tabline
(for vim in a terminal) or:help setting-guitablabel
(for gvim). You could write a function that checks for a tab-local variable and returns either that or some default. Then, after opening a tab,:let t:mytablabel = 'homepage_template'
.+
for modified buffer, truncating filenames, etc.). (Which is what I need, hence this question.)