quick autohtml on write

Wed, 28 Jul 2021 01:25:16 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 28 Jul 2021 01:25:16 -0500
changeset 930
6edfe4c6ebe5
parent 929
97b6cf0bd601
child 931
55c477df9d1b

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

mercurial