]> Sergey Matveev's repositories - dotfiles.git/blobdiff - vim/.vim/plugin/whereami.vim
Detect already loaded code with simpler <SID> check
[dotfiles.git] / vim / .vim / plugin / whereami.vim
index f3a4f3c94d94c1b80b20f0f7e998e4163598f189..a6d53365224d2298347280a6c2f39790b9c4927e 100644 (file)
@@ -1,5 +1,4 @@
-if exists("g:loaded_mein_whereami") | finish | endif
-let g:loaded_mein_whereami = 1
+if exists('*<SID>pwdLoad') | finish | endif
 
 function! s:pwdLoad()
     let g:mein_pwdL=trim(system("pwd -L"))
@@ -8,7 +7,7 @@ endfunction
 
 autocmd VimEnter * call s:pwdLoad()
 
-function! WhereAmI(fmt)
+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):]
@@ -24,5 +23,5 @@ function! WhereAmI(fmt)
     echomsg where
 endfunction
 
-nmap <leader>w :call WhereAmI("gnu")<CR>
-nmap <leader>W :call WhereAmI("lldb")<CR>
+nmap <leader>w :call <SID>WhereAmI("gnu")<CR>
+nmap <leader>W :call <SID>WhereAmI("lldb")<CR>