" Vim syntax file " Language: Markdown " Maintainer: urosm " Last Change: 2024 Feb 14 if exists("b:current_syntax") finish endif syntax spell toplevel " emphasis syn region markdownItalic matchgroup=markdownDelimiter start=/\\\@1/ hi def link markdownAutomaticLink markdownUnderlined " wikilink " NOTE: update to support newlines in titles syn match markdownWikilink /\[\[.*\]\]/ contains=markdownWikilinkLabel,markdownWikilinkURL syn match markdownWikilinkLabel /\[\[\zs.\{-}\ze|.*\]\]/ contained hi def link markdownWikilinkLabel markdownLabel syn match markdownWikilinkURL /\%(\[\[\||\)\zs[^|]*\ze\]\]/ contained hi def link markdownWikilinkURL markdownUnderlined " footnote reference syn match markdownFootnoteReference /\[\zs\^.\{-}\ze\]/ hi def link markdownFootnoteReference markdownLabel " reference key syn match markdownReferenceKey /@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&-+?<>~\/]*/ hi def link markdownReferenceKey markdownLabel " html comment syn region markdownHTMLcomment start=// keepend contains=@Spell hi def link markdownHTMLcomment markdownComment " yaml syn include @YAML syntax/yaml.vim unlet! b:current_syntax syn region markdownYAMLHeader start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/^\([-.]\)\1\{2}$/ keepend contains=@YAML containedin=TOP " styling hi def link markdownComment Comment hi def link markdownConstant Constant hi def link markdownString String hi def link markdownCharacter Character hi def link markdownNumber Number hi def link markdownBoolean Boolean hi def link markdownFloat Float hi def link markdownIdentifier Identifier hi def link markdownFunction Function hi def link markdownStatement Statement hi def link markdownConditional Conditional hi def link markdownRepeat Repeat hi def link markdownLabel Label hi def link markdownOperator Operator hi def link markdownKeyword Keyword hi def link markdownException Exception hi def link markdownPreProc PreProc hi def link markdownInclude Include hi def link markdownDefine Define hi def link markdownMacro Macro hi def link markdownPreCondit PreCondit hi def link markdownType Type hi def link markdownStorageClass StorageClass hi def link markdownStructure Structure hi def link markdownTypedef Typedef hi def link markdownSpecial Special hi def link markdownSpecialChar SpecialChar hi def link markdownTag Tag hi def link markdownDelimiter Delimiter hi def link markdownSpecialComment SpecialComment hi def link markdownDebug Debug hi def link markdownUnderlined Underlined hi def link markdownIgnore Ignore hi def link markdownError Error hi def link markdownItalic Italic hi def link markdownBold Bold hi def link markdownBoldItalic BoldItalic hi def link markdownStrike Strike hi def link markdownTitle Title let b:current_syntax = "markdown" " vim:set sw=2: