-function! WhereAmI(fmt)
- let fullpath = expand("%:p")
- 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 <leader>w :call WhereAmI("gnu")<CR>
-nmap <leader>W :call WhereAmI("lldb")<CR>
+if exists("*whereami#pwdLoad") | finish | endif
+autocmd VimEnter * call whereami#pwdLoad()
+nmap <leader>w :call whereami#do("%s:%d")<CR>
+nmap <leader>W :call whereami#do("breakpoint set --file %s --line %d")<CR>