6 Commits

Author SHA1 Message Date
sencer
2178b5cc6a Merge 04701225ad into f9f845f28f 2025-01-04 02:16:08 +03:00
Sencer Selcuk
04701225ad merge upstream 2016-11-09 12:04:44 -05:00
Sencer Selcuk
b52db95b7c better and more correct handling of front matter 2016-02-02 12:14:07 -05:00
Sencer Selcuk
1a4686fce8 Highlight YAML header 2016-01-24 12:01:20 -05:00
Sencer Selcuk
8817c773d7 YAML front matter as comment 2016-01-24 11:52:50 -05:00
Sencer Selcuk
225338e9b7 Fold YAML front matter 2016-01-24 11:52:05 -05:00
2 changed files with 16 additions and 0 deletions

View File

@@ -54,6 +54,18 @@ function! MarkdownFold() abort
return ">2"
endif
" Front matter
if v:lnum == 1 && line == '---'
let b:markdown_frontmatter = 1
return ">1"
endif
" End of front matter
if (line == '...') && b:markdown_frontmatter
unlet b:markdown_frontmatter
return '<1'
endif
return "="
endfunction

View File

@@ -85,6 +85,10 @@ syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
syn region markdownCodeBlock start="^\n\( \{4,}\|\t\)" end="^\ze \{,3}\S.*$" keepend
syn include @yamlTop syntax/yaml.vim
syntax match YAMLFrontMatter /\%^---\_.\{-}\.\.\.$/ contains=@yamlTop
unlet! b:current_syntax
" TODO: real nesting
syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained