.vim/ftplugin/markdown.vim

Wed, 28 Jul 2021 01:34:01 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 28 Jul 2021 01:34:01 -0500
changeset 931
55c477df9d1b
parent 930
6edfe4c6ebe5
permissions
-rw-r--r--

whoops

runtime ftplugin/text.vim
setl equalprg=pandoc\ -f\ markdown\ -t\ markdown

if !exists('b:markdown_autohtml')
  let b:markdown_autohtml = 0
endif

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