I would like to have the following feature in VIM (GVIM in particular). I think Sublime Text has something like that:
Example:
When there are tabs for the following files:
Tab names would be then:
justAfile.txt | files\myfile.txt | backup\myfile.txt
Is this doable with some clever configuration?
In GVIM, you can customize the tab labels with the 'guitablabel'
option.
In terminal Vim; there's no 'guitablabel'
equivalent; one has to render the entire 'tabline'
. Fortunately, the Vim help has an example which delegates the label rendering to a separate function, so re-using your custom function is pretty easy.
The help pages for the mentioned options link to examples; you probably have to use fnamemodify()
to canonicalize all buffers' paths to full absolute paths, find the common base directory, and then strip that off the paths.
On the other hand, if it's okay for you to :cd
to the base directory, you'll get that kind of tab label pretty much out-of-the-box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With