X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fautoload%2Fwhereami.vim;fp=vim%2F.vim%2Fautoload%2Fwhereami.vim;h=5b5b1d86920b5ae5cd731e5a4f6aebc9cd31cda9;hb=1280549be01e3ce72d9e0aeef6254a1ff14a25a3;hp=0000000000000000000000000000000000000000;hpb=86cacc081de452eb66d50f13261310b07f8ca2d4;p=dotfiles.git diff --git a/vim/.vim/autoload/whereami.vim b/vim/.vim/autoload/whereami.vim new file mode 100644 index 0000000..5b5b1d8 --- /dev/null +++ b/vim/.vim/autoload/whereami.vim @@ -0,0 +1,14 @@ +function! whereami#pwdLoad() + let g:whereami_pwdL=trim(system("pwd -L")) + let g:whereami_pwdP=trim(system("pwd -P")) +endfunction + +function! whereami#do(fmt) abort + let fullpath = expand("%:p") + if fullpath[:len(g:whereami_pwdP)-1] ==# g:whereami_pwdP + let fullpath = g:whereami_pwdL . fullpath[len(g:whereami_pwdP):] + endif + let where = printf(a:fmt, fullpath, line(".")) + let @* = where + echomsg where +endfunction