diff --git a/vimrc b/vimrc index c74df51..5ba48fc 100644 --- a/vimrc +++ b/vimrc @@ -231,6 +231,19 @@ function s:SetMarkdownSettings() "{{{2 setlocal autoindent setlocal formatoptions=tcq "set VIms default + function! ShowInBrowser() + let l:uri = expand("%:p:r") . ".html" + call system(g:browser . " " . l:uri) + echohl Statement + echo "Opened '" . l:uri ."' in " . g:browser + echohl None + endfunction + + if !exists(":ShowInBrowser") + command ShowInBrowser call s:ShowInBrowser() + map :ShowInBrowser + endif + autocmd BufWritePost *.md :silent make endfunction "}}}