]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vim/plugin/whereami.vim
8c55eded5f032db1fed06e8819392f70a01c70a3
[dotfiles.git] / vim / .vim / plugin / whereami.vim
1 if exists("g:loaded_mein_whereami") | finish | endif
2 let g:loaded_mein_whereami = 1
3
4 function! WhereAmI(fmt)
5     let fullpath = expand("%:p")
6     if a:fmt == "gnu"
7         let where = fullpath . ":" . line(".")
8     elseif a:fmt == "lldb"
9         let where = "breakpoint set --file " . fullpath . " --line " . line(".")
10     else
11         let where = "unknown fmt"
12     endif
13     let @* = where
14     echomsg where
15 endfunction
16
17 nmap <leader>w :call WhereAmI("gnu")<CR>
18 nmap <leader>W :call WhereAmI("lldb")<CR>