function! WhereAmI() let where = expand('%:p') . ":" . line('.') let @* = where echomsg where endfunction nmap w :call WhereAmI()