1
0
Fork 0
dot/.config/nvim/after/syntax/markdown.vim

20 lines
871 B
VimL

if exists("b:current_syntax")
unlet! b:current_syntax
endif
" yaml
syntax clear markdownYamlHead
syntax region markdownYamlHead start="^-\{3}\n\S" end="\S\n\%(-\|\.\)\{3}$" keepend contains=@markdownYamlTop,@Spell
" citation
syntax match markdownPCite "\^\@<!\[\_[^\[\]]\{-}-\{0,1}@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\_.\{-}\]" contains=@markdownInline,markdownCiteKey
syn match markdownICite "@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\s\[.\{-1,}\]" contains=markdownCiteKey,@Spell display
syn match markdownCiteKey /\(-\=@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\)/ containedin=markdownPCite,markdownICite contains=@NoSpell display
hi def link markdownPCite Comment
hi def link markdownICite Comment
hi def link markdownCiteKey markdownLabel
hi def link markdownLabel Label
let b:current_syntax = "markdown"