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

Thu, 11 Apr 2024 13:19:24 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 11 Apr 2024 13:19:24 -0400
changeset 1145
beb170aa6789
parent 1029
9265f8508e4c
child 1163
40367220022e
permissions
-rw-r--r--

add .luarc.jsonc

1029
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 runtime ftplugin/text.vim
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 setl equalprg=pandoc\ -f\ markdown\ -t\ markdown
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 if !exists('b:markdown_autohtml')
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 let b:markdown_autohtml = 0
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 endif
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 function! s:autohtml() abort
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 if get(b:, 'markdown_autohtml', 0)
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 silent !md2html -o "%:p.html" "%:p"
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 endif
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 endfunction
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 augroup Markdown
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 autocmd!
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 autocmd BufWritePost <buffer> call s:autohtml()
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 augroup END

mercurial