-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Description
In vim-header when editing markdown files the header automatically uses a code block.
I never saw this type of header in markdown files. Is there a reason for it?
I think it is more common to have a yaml front matter as e.g. used by Hugo.
At least this should be optional I think. This would also only need a minimal change to your code.
Proposals
-
Change the comment string from code block to yaml in
autoload/header.vim, i.e. use---. -
If the code block header is a general default (I don't know about) we can at least make the yaml frontmatter optional by introducing a new variable
; toggle front matter format as yaml let g:header_markdown_yaml_format = 1
then in
autoload/header.vimwe set the defaultif !exists('g:header_markdown_yaml_format') let g:header_markdown_yaml_format = 0 endif
and only add to the markdown
elseifafter the default stuffif g:header_markdown_yaml_format == 1 let b:comment_begin = '---' let b:comment_end = '---' endif
The changes to your code are minimal to support
yamlfront matter
Bottom Line
I currently use my 1. proposal locally, but would also be willing to implement the 2. one.
Let me know what you think / prefer.