.vim/ftplugin/markdown.vim

Mon, 20 Sep 2021 15:10:27 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 20 Sep 2021 15:10:27 -0500
changeset 945
29657d7ea734
parent 931
55c477df9d1b
permissions
-rw-r--r--

Drop 'w' formatoption for text and markdown, only mail

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