.config/nvim/after/ftplugin/markdown.vim

Mon, 20 Feb 2023 00:53:33 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 20 Feb 2023 00:53:33 -0600
changeset 1039
91900ecf0e8c
parent 1029
9265f8508e4c
child 1163
40367220022e
permissions
-rw-r--r--

Add gui (fvim) settings

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