" " source this file with " :source % " " and upload with " ctrl+u " fun! MirrorUp() " substitute ~/mirrors/ in current file path with ftp:// let l:ftpath = fnamemodify(bufname("%"),":p:s?^" . $HOME . "/mirrors/?ftp://?") if match(l:ftpath, "^ftp://") == 0 | exec "w " . l:ftpath | endif endfun nmap :call MirrorUp()