Open clinta opened 6 years ago
Same problem.
I got it working with:
set titlestring=vi\:\ %-25.55F\ %a%r%m titlelen=70
Good enough for me.
Seems like any solution for this is going to need to use readlink -f FILENAME
(on Linux) to handle this case correctly. Consider the following:
gvim ../foo
cd ..
gvim foo
Here we have two different names given to gvim, but for the same file. Using readlink -f
to get the canonical path will ensure the equality test is accurate. Granted $SUBJECT is about two different files and I'm describing two references to the same file, but I believe it still applies and simplifies how the fix should work.
It appears from testing that vim's fnamemodify
function does yield the canonical path when given the :p
option. So that makes a good platform-agnostic solution here.
I tried working around this with
set titlestring=%{expand(\"%:p:h\")}
in my vimrc, but this did not solve the issue.