]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vim/plugin/whereami.vim
Not all software accepts /usr/home path as /home
[dotfiles.git] / vim / .vim / plugin / whereami.vim
1 function! WhereAmI(fmt)
2     let fullpath = substitute(expand("%:p"), "/usr/home/", "/home/", "")
3     if a:fmt == "gnu"
4         let where = fullpath . ":" . line(".")
5     elseif a:fmt == "lldb"
6         let where = "breakpoint set --file " . fullpath . " --line " . line(".")
7     else
8         let where = "unknown fmt"
9     endif
10     let @* = where
11     echomsg where
12 endfunction
13
14 nmap <leader>w :call WhereAmI("gnu")<CR>
15 nmap <leader>W :call WhereAmI("lldb")<CR>