]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vim/autoload/whereami.vim
Vim scripts refactoring
[dotfiles.git] / vim / .vim / autoload / whereami.vim
1 function! whereami#pwdLoad()
2     let g:whereami_pwdL=trim(system("pwd -L"))
3     let g:whereami_pwdP=trim(system("pwd -P"))
4 endfunction
5
6 function! whereami#do(fmt) abort
7     let fullpath = expand("%:p")
8     if fullpath[:len(g:whereami_pwdP)-1] ==# g:whereami_pwdP
9         let fullpath = g:whereami_pwdL . fullpath[len(g:whereami_pwdP):]
10     endif
11     let where = printf(a:fmt, fullpath, line("."))
12     let @* = where
13     echomsg where
14 endfunction