Wed, 28 Jul 2021 01:25:16 -0500
quick autohtml on write
.vim/ftplugin/markdown.vim | file | annotate | diff | comparison | revisions |
--- a/.vim/ftplugin/markdown.vim +++ b/.vim/ftplugin/markdown.vim @@ -1,3 +1,15 @@ runtime ftplugin/text.vim setl equalprg=pandoc\ -f\ markdown\ -t\ markdown +let b:markdown_autohtml = 0 + +function! s:autohtml() abort + if get(b:, 'markdown_autohtml', 0) + silent !md2html -o "%:p.html" "%:p" + endif +endfunction + +augroup Markdown + autocmd! + autocmd BufWritePost <buffer> call s:autohtml() +augroup END