I have the following setup:
mkdir /1
mkdir /1/2
mkdir /1/2/3
ln -s /1/2/3 /1/3
If I do cd /1/3
, and then pwd
, I get /1/3
. If I use pwd -P
, I can get /1/2/3
, or pwd -L
to force /1/3
.
In VIM, I'm looking for a way to get the /1/3
.
If I open a file in /1/3/foo.txt
, and I use something like fnamemodify(bufname(winbufnr(0)), ':p:h')
, it returns /1/2/3
.
How can I tell it to give me the same directory that pwd
would give?