Vim - ステータスバーとリンク

Vim - ステータスバーとリンク

この状況に関して:

cd ~/temp
ln -s /var/lib/alsa alsa
cd alsa
pwd -> /home/<username>/temp/alsa

ただし、出力ディレクトリでファイルを開くと、ステータス行に次のように表示されますpwdvim

/var/lib/alsa/asound.state

pwdリンクをクリックする代わりに結果を表示するにはどうすればよいですか?

私は以下を使用しています:

set statusline=%F%=%m\ %y\ \%r\ %1*\ \%l\:\%c\ \%2*\ \ \%p%%\ \ 

ベストアンサー1

vimでこれを直接行うことはできません。 vimは常にリンクを解析し、実際のファイル名を見つけます。

から:h E773

For symbolic links Vim resolves the links to find the name of the actual file.  
The swap file name is based on that name.  Thus it doesn't matter by what name  
you edit the file, the swap file name will normally be the same.

外部コマンドを使用して、現在の作業ディレクトリと%fステータス行を取得できます。

努力する:

set statusline=%{system('echo\ -n\ $\(pwd\ -L\)')}/%f%=%m\ %y\ \%r\ %1*\ \%l\:\%c\ \%2*\ \ \%p%%\ \ 

より多くの情報を知りたい場合:

:h E773
:h todo.txt
:h version7.txt

おすすめ記事