.vim/ftplugin/markdown.vim

Sun, 12 Feb 2023 14:42:31 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 12 Feb 2023 14:42:31 -0600
changeset 1014
b57969db48db
parent 931
55c477df9d1b
permissions
-rw-r--r--

start nvim config

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