Sat, 11 Mar 2023 01:51:23 -0500
port custom autocmds to lua
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 | 4 | if !exists('b:markdown_autohtml') |
5 | let b:markdown_autohtml = 0 | |
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 |