As I open new tabs in vi/vim(7.2), if the opened files are in different paths the tab title displays the complete path and hogs the screen real estate so the other tabs are not visible. This means I can't use my mouse to click to the tab I want but have to resort to : & keyboard commands to move between tabs.
Is there any way I can restrict the tab titles to a max 'size/length', so I only get to see say the last 12 characters of a file in a distant relative path ?
You can do this pretty nicely for gvim with the setting 'guitablabel'.
Here's an excerpt from my .gvimrc, which modifies the default to only show up to 12 characters of the filename, but keeps the '+' for modified buffers. The tooltip is left unmodified, so you can get the full path from that or by pressing Ctrl-G in command mode.
if version >= 700 "set showtabline to show when more than one tab set showtabline=1 "set tab labels to show at most 12 characters set guitablabel=%-0.12t%M endif " don't show the toolbar in the GUI (only the menu) set guioptions-=T " don't show tear-off menus set guioptions-=t
In reply to my own question:
After reading Chad Birch above and googling for setting-tabline I found the TabLineSet plugin that does the trick, and some of script explanations here
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