Getting the logical path in VIM when there's a symlink

前端 未结 1 1206
小蘑菇
小蘑菇 2020-12-19 03:56

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 g

相关标签:
1条回答
  • 2020-12-19 04:21

    It appears you can't, other than via system('pwd -L'). According to the vim_use mailing list Vim automatically resolves symlinks nowadays.

    See the text around :h E773 for rationale; if Vim went by symlinks instead of resolved filename, it'd be possible to have the same file open in two buffers under two different names, and Vim would become confused trying to figure out where the swap file should be. See also in :h version7.txt:

    Unix: When editing a file through a symlink the swap file would use the name of the symlink. Now use the name of the actual file, so that editing the same file twice is detected.

    0 讨论(0)
提交回复
热议问题