.vim/ftplugin/markdown.vim

Wed, 28 Jul 2021 01:48:10 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 28 Jul 2021 01:48:10 -0500
changeset 932
f87943eb16aa
parent 931
55c477df9d1b
permissions
-rw-r--r--

stubexec fixes

368
91d4fb4e0a42 improve text editing experience?
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 runtime ftplugin/text.vim
657
628b4b962086 Use pandoc as markdown equalprg, use only 72 for text width
Meredith Howard <mhoward@roomag.org>
parents: 368
diff changeset
2 setl equalprg=pandoc\ -f\ markdown\ -t\ markdown
628b4b962086 Use pandoc as markdown equalprg, use only 72 for text width
Meredith Howard <mhoward@roomag.org>
parents: 368
diff changeset
3
931
Meredith Howard <mhoward@roomag.org>
parents: 930
diff changeset
4 if !exists('b:markdown_autohtml')
Meredith Howard <mhoward@roomag.org>
parents: 930
diff changeset
5 let b:markdown_autohtml = 0
Meredith Howard <mhoward@roomag.org>
parents: 930
diff changeset
6 endif
930
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
7
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
8 function! s:autohtml() abort
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
9 if get(b:, 'markdown_autohtml', 0)
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
10 silent !md2html -o "%:p.html" "%:p"
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
11 endif
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
12 endfunction
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
13
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
14 augroup Markdown
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
15 autocmd!
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
16 autocmd BufWritePost <buffer> call s:autohtml()
6edfe4c6ebe5 quick autohtml on write
Meredith Howard <mhoward@roomag.org>
parents: 657
diff changeset
17 augroup END

mercurial