From 875beb2f124534aea79b9e9011777f64ffb00303 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 13 May 2021 14:48:35 +0300 Subject: [PATCH] Symbolic links friendly WhereAmI --- vim/.vim/plugin/whereami.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vim/.vim/plugin/whereami.vim b/vim/.vim/plugin/whereami.vim index 8c55ede..f3a4f3c 100644 --- a/vim/.vim/plugin/whereami.vim +++ b/vim/.vim/plugin/whereami.vim @@ -1,8 +1,18 @@ if exists("g:loaded_mein_whereami") | finish | endif let g:loaded_mein_whereami = 1 +function! s:pwdLoad() + let g:mein_pwdL=trim(system("pwd -L")) + let g:mein_pwdP=trim(system("pwd -P")) +endfunction + +autocmd VimEnter * call s:pwdLoad() + function! WhereAmI(fmt) let fullpath = expand("%:p") + if fullpath[:len(g:mein_pwdP)-1] ==# g:mein_pwdP + let fullpath = g:mein_pwdL . fullpath[len(g:mein_pwdP):] + endif if a:fmt == "gnu" let where = fullpath . ":" . line(".") elseif a:fmt == "lldb" -- 2.44.0