The Problem
I understand that a variant of this question might have been answered.
I have tried :set guitablabel=%t
, but there are two problems:
- It doesn't work in Vim in the terminal (since gui settings only work for GVim). I exclusively use terminal Vim, so the answer given doesn't apply.
- Files with same names in different directories are not shown their relative folders for distinction.
Current Situation
To better understand my question, say I have a project folder, awesome-project
with the following structure:
awesome-project
AAA/
file1.txt
file2.txt
CCC/
special.txt
BBB/
file2.txt
file3.txt
DDD/
special.txt
Say I cd
to the project in my terminal and vim
from there.Then I proceed to open all the files in separate tabs.
Currently, my vim is set up to display the tabs as following (the |
s are separators - use your imagination!):
AAA/file1.txt | AAA/file1.txt | AAA/CCC/special.txt | BBB/file2.txt | BBB/file3.txt | BBB/DDD/special.txt
What I Want
I want the tabs to display as:
file1.txt | AAA/file2.txt | CCC/special.txt | BBB/file2.txt | file3.txt | DDD/special.txt
or what Sublime Text does:
file1.txt | file2.txt --- AAA | special.txt --- AAA/CCC | file2.txt --- BBB | file3.txt | special.txt --- BBB/DDD
Essentially, given the current tabs have file names that are unique, all tabs should just display their file name. Otherwise, provide the first distinct relative folder to display in the tab so I can tell which files are file.
This is a feature in many other text editors (Sublime Text, Atom) that I would really like to keep because the relative path file names are too long for my own good.
Any help would be appreciated, whether it be:
- a simple command that fixes the problem (yay!)
- an available plugin
- tips on how I can configure this manually in
.vimrc