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

Sun, 14 Jul 2024 22:56:35 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 14 Jul 2024 22:56:35 -0500
changeset 1175
7907b9c30399
parent 1163
40367220022e
permissions
-rw-r--r--

Add which-key.nvim and descriptions

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
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 if !exists('b:markdown_autohtml')
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 let b:markdown_autohtml = 0
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 endif
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 function! s:autohtml() abort
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 if get(b:, 'markdown_autohtml', 0)
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 silent !md2html -o "%:p.html" "%:p"
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 endif
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 endfunction
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 augroup Markdown
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 autocmd!
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 autocmd BufWritePost <buffer> call s:autohtml()
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 augroup END

mercurial