X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Fwhereami.vim;fp=vim%2F.vim%2Fplugin%2Fwhereami.vim;h=f3a4f3c94d94c1b80b20f0f7e998e4163598f189;hp=8c55eded5f032db1fed06e8819392f70a01c70a3;hb=875beb2f124534aea79b9e9011777f64ffb00303;hpb=d8318e96dbb93272ed83bb841a7cab176300600b 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"