.vim/ftplugin/markdown.vim

Sun, 19 Feb 2023 11:31:07 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 19 Feb 2023 11:31:07 -0600
changeset 1028
77e65ab97892
parent 931
55c477df9d1b
permissions
-rw-r--r--

fsckobjects has also been a nuisance. maybe git just isn't great at integrity!

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