我正在使用Mac和MacVim 7.3。如何在vim中將符號鏈接擴展爲文件名的完整路徑?
我有一個符號鏈接〜/ some/symlink,它是一個真實文件〜/ some/actual_file的鏈接。當我「vim〜/ some/symlink」時,它會在vim中用vim的狀態行顯示文件名稱是〜/ some/symlink,這是有道理的。
如何從vim中獲取「real」文件的完整路徑〜/ some/actual_file?我想要vim status行說〜/ some/actual_file而不是〜/ some/symlink。
我預計VIM功能解析()會工作,因爲它幫助說明(粘貼以下),但解決(「〜/一些/符號鏈接」)返回〜/一些/符號鏈接,所以這是沒有任何幫助。
我錯過了什麼?謝謝!
resolve({filename}) *resolve()* *E655*
On MS-Windows, when {filename} is a shortcut (a .lnk file),
returns the path the shortcut points to in a simplified form.
On Unix, repeat resolving symbolic links in all path
components of {filename} and return the simplified result.
To cope with link cycles, resolving of symbolic links is
stopped after 100 iterations.
On other systems, return the simplified {filename}.
使用vim,您可以執行命令並使用system(「cmd」)獲取輸出。有了這個,migth可以調用「readlink -m」來獲得真正的路徑。 – Lynch 2011-04-26 18:22:14