1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-17 19:40:29 +01:00

Added S-F5 (open in browser) for markdown filetype

This commit is contained in:
2017-06-17 11:45:13 +02:00
parent 03c7587ef4
commit 4060fc96c0

13
vimrc
View File

@@ -231,6 +231,19 @@ function s:SetMarkdownSettings() "{{{2
setlocal autoindent setlocal autoindent
setlocal formatoptions=tcq "set VIms default setlocal formatoptions=tcq "set VIms default
function! <SID>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 <S-F5> :ShowInBrowser<CR>
endif
autocmd BufWritePost *.md :silent make autocmd BufWritePost *.md :silent make
endfunction endfunction
"}}} "}}}