開いてるファイルをSafariで確認
let g:localhost = 'http://oppara/' let g:docroot = '/Users/oppara/Sites/' function! RunSafari() :write let b:fullpath = expand( "%:p" ) let $url = substitute( b:fullpath, g:docroot, g:localhost, '' ) "echo $url !open -a safari $url endfunction nnoremap <silent> <D-r> :call RunSafari()<CR>