From 4060fc96c0fd7ad9b381356d5101d4e6d9bcff75 Mon Sep 17 00:00:00 2001 From: gryf Date: Sat, 17 Jun 2017 11:45:13 +0200 Subject: [PATCH] Added S-F5 (open in browser) for markdown filetype --- vimrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 "}}}