X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Fwhereami.vim;h=33981349176e2fd2643be57d23443db67b86bc86;hp=a6d53365224d2298347280a6c2f39790b9c4927e;hb=1280549be01e3ce72d9e0aeef6254a1ff14a25a3;hpb=86cacc081de452eb66d50f13261310b07f8ca2d4 diff --git a/vim/.vim/plugin/whereami.vim b/vim/.vim/plugin/whereami.vim index a6d5336..3398134 100644 --- a/vim/.vim/plugin/whereami.vim +++ b/vim/.vim/plugin/whereami.vim @@ -1,27 +1,4 @@ -if exists('*pwdLoad') | finish | endif - -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! s: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" - let where = "breakpoint set --file " . fullpath . " --line " . line(".") - else - let where = "unknown fmt" - endif - let @* = where - echomsg where -endfunction - -nmap w :call WhereAmI("gnu") -nmap W :call WhereAmI("lldb") +if exists("*whereami#pwdLoad") | finish | endif +autocmd VimEnter * call whereami#pwdLoad() +nmap w :call whereami#do("%s:%d") +nmap W :call whereami#do("breakpoint set --file %s --line %d")