2024-01-27 21:12:38 +01:00
|
|
|
" Vim syntax file
|
|
|
|
" Language: Markdown
|
|
|
|
" Maintainer: urosm <urosm@kompot.si>
|
|
|
|
" Last Change: 2024 Jan 13
|
|
|
|
|
|
|
|
if exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
syntax spell toplevel
|
|
|
|
|
|
|
|
" html
|
2024-01-27 21:12:38 +01:00
|
|
|
runtime! syntax/html.vim
|
|
|
|
unlet! b:current_syntax
|
|
|
|
|
2024-02-11 10:25:16 +01:00
|
|
|
" setext heading
|
2024-02-14 15:13:12 +01:00
|
|
|
syn match markdownSetexHeading /\%(\%^\|^\n\)\@2<=.\+\n[=-]\+\%(\n$\|\%$\)\@=/ contains=@markdownInline,markdownSetextHeadingDelimiter,markdownHeadingAttribute
|
2024-02-11 10:25:16 +01:00
|
|
|
syn match markdownSetextHeadingDelimiter /^[=-]\+$/ contained
|
|
|
|
hi def link markdownSetextHeadingDelimiter markdownDelimiter
|
|
|
|
|
|
|
|
" atx heading
|
2024-02-14 15:13:12 +01:00
|
|
|
syn match markdownAtxHeading /\%(\%^\|^\n\)\@2<=#\{1,6} .*\%(\n$\|\%$\)\@=/ contains=@markdownInline,markdownAtxHeadingDelimiter,markdownHeadingAttribute
|
2024-02-11 10:25:16 +01:00
|
|
|
syn match markdownAtxHeadingDelimiter /^#\{1,6}/ contained
|
|
|
|
hi def link markdownAtxHeadingDelimiter markdownDelimiter
|
2024-02-14 15:13:12 +01:00
|
|
|
|
|
|
|
" heading identifier
|
2024-02-11 10:25:16 +01:00
|
|
|
syn match markdownHeadingAttribute /.*\zs{.\{-}}$/ contained
|
|
|
|
hi def link markdownHeadingAttribute markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" block quotation
|
|
|
|
syn region markdownBlockquote start=/\%(\%^\|^\n\)\@2<= \{,3}>/ end=/\%(\n$\|\%$\)\@=/ contains=markdownBlockquoteDelimiter
|
|
|
|
syn match markdownBlockquoteDelimiter /^\%(\s*>\)\+/ contained
|
|
|
|
hi def link markdownBlockquoteDelimiter markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" indented code block
|
|
|
|
"syn match markdownIndentedCodeBlock /\%(\%^\|^\n\)\@2<=\%(^\%( \{4,}\|\t\).*\n\)\+\%($\|\%$\)\@=/
|
|
|
|
"hi def link markdownIndentedCodeBlock markdownSpecial
|
2024-02-11 10:25:16 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" fenced code block
|
|
|
|
"syn region markdownFencedCodeBlock start=/^\z(\~\{3,}\~*\)/ end=/^\z1\~*$/ keepend contains=markdownFencedCodeBlockDelimiter
|
|
|
|
"syn region markdownFencedCodeBlock start=/^\z(\`\{3,}\`*\)/ end=/^\z1\`*$/ keepend contains=markdownFencedCodeBlockDelimiter
|
|
|
|
"hi def link markdownFencedCodeBlock markdownSpecial
|
2024-02-11 10:25:16 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" line block
|
|
|
|
"syn match markdownLineBlock /\%(\%^\|^\n\)\@2<=|.*\n\%(^\%(|\| \).*\n\)*\%($\|\%$\)\@=/ contains=markdownLineBlockDelimiter
|
|
|
|
"syn match markdownLineBlockDelimiter /^|/ contained
|
|
|
|
"hi def link markdownLineBlockDelimiter markdownDelimiter
|
2024-02-11 10:25:16 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" bullet list
|
|
|
|
"syn region markdownBulletList start=/\%(\%^\|^\n\)\@2<= \{,3}[*+-] / end=/\%(\n\n\S\)\@=/ contains=markdownBulletListDelimiter,markdownOrderedList,markdownOrderedListDelimiter,markdownBlockquote,markdownBlockquoteDelimiter
|
|
|
|
"syn match markdownBulletListDelimiter /^\s*\zs[*+-]/ contained
|
|
|
|
"hi def link markdownBulletListDelimiter markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" ordered list
|
|
|
|
"syn region markdownOrderedList start=/\%(\%^\|^\n\)\@2<= \{,3}\%(\%(\d\+\|\l\|\#\|@\)\. \|(\=\%(\d\+\|\l\|\#\|@\)) \)/ end=/\%(\n\n\S\)\@=/ contains=markdownOrderedListDelimiter,markdownTaskListDelimiter,markdownBulletList,markdownBulletListDelimiter,markdownBlockquote,markdownBlockquoteDelimiter
|
|
|
|
"syn match markdownOrderedlistDelimiter /^\s*\%(\%(\d\+\|\l\|\#\|@\)\. \|(\=\%(\d\+\|\l\|\#\|@\)) \)/ contained
|
|
|
|
"hi def link markdownOrderedListDelimiter markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" task list delimiter
|
|
|
|
"syn match markdownTaskListDelimiter /\%(\%(\%(\d\+\|\l\|\#\|@\)\.\|(\=\%(\d\+\|\l\|\#\|@\))\) \s*\)\@<=\[[ x]\] / contained
|
|
|
|
"hi def link markdownTaskListDelimiter markdownSpecial
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" definition list
|
|
|
|
" TODO
|
2024-02-11 10:25:16 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" example list
|
|
|
|
"syn region markdownExampleList start=/\%(\%^\|^\n\)\@2<= \{,3}(@[[:lower:][:upper:]_-]*)/ end=/\%(\n\n \{,3}\S\)\@=/ contains=markdownExampleListDelimiter
|
|
|
|
"syn match markdownExampleListDelimiter /^ \{,3}(@.\{-}) / contained
|
|
|
|
"hi def link markdownExampleListDelimiter markdownDelimiter
|
|
|
|
"syn match markdownExampleListLabel /@.\{-}\ze)/ containedin=markdownExampleListDelimiter contains=ALLBUT,markdownExampleListReference
|
|
|
|
"hi def link markdownExampleListLabel markdownSpecial
|
|
|
|
"syn match markdownExampleListReference /(@[[:lower:][:upper:]_-]*)/ !contained
|
|
|
|
"hi def link markdownExampleListReference Error
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" horizontal rule
|
|
|
|
"syn match markdownHRule /^\n\s*\*\s*\(\*\s*\)\{2,}\n$/ display
|
|
|
|
"syn match markdownHRule /^\n\s*\-\s*\(\-\s*\)\{2,}\n$/ display
|
|
|
|
"syn match markdownHRule /^\n\s*_\s*\(_\s*\)\{2,}\n$/ display
|
|
|
|
"hi def link markdownHRule markdownDelimiter
|
|
|
|
|
|
|
|
" table
|
|
|
|
" TODO
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" titleblock
|
|
|
|
"syn region markdownTitleBlock start=/\%^%/ end=/\n$/ contains=@markdownInline,markdownTitleBlockDelimiter
|
|
|
|
"hi def link markdownTitleBlock markdownTitle
|
|
|
|
"syn match markdownTitleBlockDelimiter /%\ / contained
|
|
|
|
"hi def link markdownTitleBlockDelimiter markdownDelimiter
|
|
|
|
|
|
|
|
" definition
|
|
|
|
"syn region markdownReferenceDefinition start=/\[.\{-}\]:/ end=/\(\n\s*".*"$\|$\)/ keepend
|
|
|
|
"hi def link markdownReferenceDefinition markdownDelimiter
|
|
|
|
"syn match markdownReferenceDefinitionLabel /\[\zs.\{-}\ze\]:/ contained containedin=markdownReferenceDefinition display
|
|
|
|
"hi def link markdownReferenceDefinitionLabel markdownLabel
|
|
|
|
"syn match markdownReferenceDefinitionURL /:\s*\zs.*/ contained containedin=markdownReferenceDefinition
|
|
|
|
"hi def link markdownReferenceDefinitionURL markdownUnderlined
|
|
|
|
"syn match markdownReferenceDefinitionTitle /\s*".\{-}"/ contained containedin=markdownReferenceDefinition,markdownReferenceDefinitionURL contains=@Spell,markdownAmpersandEscape
|
|
|
|
"hi def link markdownReferenceDefinitionTitle markdownTitle
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" strikeout
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownStrike start=/\~\~/ end=/\~\~/ contains=markdownStrikeout,@Spell keepend
|
|
|
|
"hi def link markdownStrike htmlStrike
|
|
|
|
"syn match markdownStrikeDelimiter /\~\~/ contained
|
|
|
|
"hi def link markdownStrikeDelimiter markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" subscript
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownSubscript start=/\~\(\([[:graph:]]\(\\ \)\=\)\{-}\~\)\@=/ end=/\~/ contains=markdownSubscriptDelimiter keepend
|
|
|
|
"syn match markdownSubscriptDelimiter /\~/ contained
|
|
|
|
"hi def link markdownSubscriptDelimiter markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" superscript
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownSuperscript start=/\^\(\([[:graph:]]\(\\ \)\=\)\{-}\^\)\@=/ skip=/\\ / end=/\^/ contains=markdownSuperscriptDelimiter keepend
|
|
|
|
"syn match markdownSuperscriptDelimiter /\^/ contained
|
|
|
|
"hi def link markdownSuperscriptDelimiter markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
" simple table
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\{2,}\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownDelimitedCodeBlockStart,markdownYAMLHeader keepend
|
|
|
|
"syn match markdownSimpleTableDelims /\-/ contained containedin=markdownSimpleTable
|
|
|
|
"syn match markdownSimpleTableHeader /\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)/ contained containedin=markdownSimpleTable
|
|
|
|
"hi def link markdownSimpleTableDelims markdownDelimiter
|
|
|
|
"hi def link markdownSimpleTableHeader markdownBold
|
|
|
|
|
|
|
|
"syn region markdownTable start=/\%#=2^\(-\{2,}\s*\)\+\n\n\@!/ end=/\%#=2^\(-\{2,}\s*\)\+\n\n/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownYAMLHeader keepend
|
|
|
|
"syn match markdownTableDelims /\-/ contained containedin=markdownTable
|
|
|
|
"syn region markdownTableMultilineHeader start=/\%#=2\(^-\{2,}\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=markdownTable
|
|
|
|
"hi def link markdownTableMultilineHeader markdownBold
|
|
|
|
"hi def link markdownTableDelims markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" grid table
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownGridTable start=/\%#=2\n\@1<=+-/ end=/+\n\n/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownYAMLHeader keepend
|
|
|
|
"syn match markdownGridTableDelims /[\|=]/ contained containedin=markdownGridTable
|
|
|
|
"syn match markdownGridTableDelims /\%#=2\([\-+][\-+=]\@=\|[\-+=]\@1<=[\-+]\)/ contained containedin=markdownGridTable
|
|
|
|
"syn match markdownGridTableHeader /\%#=2\(^.*\n\)\(+=.*\)\@=/ contained containedin=markdownGridTable
|
|
|
|
"hi def link markdownGridTableDelims markdownDelimiter
|
|
|
|
"hi def link markdownGridTableHeader markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" pipe table
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownPipeTable start=/\%#=2\([+|]\n\)\@<!\n\@1<=|\(.*|\)\@=/ end=/|.*\n\(\n\|{\)/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownYAMLHeader keepend
|
|
|
|
"syn region markdownPipeTable start=/\%#=2^.*\n-.\{-}|/ end=/|.*\n\n/ keepend
|
|
|
|
"syn match markdownPipeTableDelims /[\|\-:+]/ contained containedin=markdownPipeTable
|
|
|
|
"syn match markdownPipeTableHeader /\(^.*\n\)\(|-\)\@=/ contained containedin=markdownPipeTable
|
|
|
|
"syn match markdownPipeTableHeader /\(^.*\n\)\(-\)\@=/ contained containedin=markdownPipeTable
|
|
|
|
"hi def link markdownPipeTableDelims markdownDelimiter
|
|
|
|
"hi def link markdownPipeTableHeader markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn match markdownTableHeaderWord /\<.\{-}\>/ contained containedin=markdownGridTableHeader,markdownPipeTableHeader contains=@Spell
|
|
|
|
"hi def link markdownTableHeaderWord markdownBold
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
" delimited code blocks
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=\~\{3,}\~*\)/ end=/^\z1\~*/ skipnl contains=markdownDelimitedCodeBlockStart,markdownDelimitedCodeBlockEnd keepend
|
|
|
|
"syn region markdownDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=`\{3,}`*\)/ end=/^\z1`*/ skipnl contains=markdownDelimitedCodeBlockStart,markdownDelimitedCodeBlockEnd keepend
|
|
|
|
"syn match markdownDelimitedCodeBlockStart /\(\(\_^\n\_^\|\%^\)\(>\s\)\?\( \+\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=markdownDelimitedCodeBlock nextgroup=markdownDelimitedCodeBlockLanguage
|
|
|
|
"syn match markdownDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@=/ contained
|
|
|
|
"syn match markdownDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=markdownDelimitedCodeBlock
|
|
|
|
"syn match markdownBlockquoteinDelimitedCodeBlock '^>' contained containedin=markdownDelimitedCodeBlock
|
|
|
|
"syn match markdownCodePre /<pre>.\{-}<\/pre>/ skipnl
|
|
|
|
"syn match markdownCodePre /<code>.\{-}<\/code>/ skipnl
|
|
|
|
"hi def link markdownDelimitedCodeBlock markdownSpecial
|
|
|
|
"hi def link markdownDelimitedCodeBlockStart markdownDelimiter
|
|
|
|
"hi def link markdownDelimitedCodeBlockEnd markdownDelimiter
|
|
|
|
"hi def link markdownDelimitedCodeBlockLanguage markdownComment
|
|
|
|
"hi def link markdownBlockquoteinDelimitedCodeBlock markdownBlockquote
|
|
|
|
"hi def link markdownCodePre markdownString
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" footnote
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn match markdownFootnoteID /\[\^[^\]]\+\]/ nextgroup=markdownFootnoteDef
|
|
|
|
"hi def link markdownFootnoteID markdownLabel
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" inline footnote
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownFootnoteDef start=/\^\[/ skip=/\[.\{-}]/ end=/\]/ contains=markdownLink,markdownLatex,markdownPCite,markdownCiteKey,markdownBold,markdownItalic,markdownBoldItalic,markdownNoFormatted,markdownSuperscript,markdownSubscript,markdownStrike,markdownEnDash,markdownEmDash,markdownEllipses,markdownBeginQuote,markdownEndQuote,@Spell,markdownAmpersandEscape skipnl keepend
|
|
|
|
"hi def link markdownFootnoteDef markdownComment
|
|
|
|
"syn match markdownFootnoteDefHead /\^\[/ contained containedin=markdownFootnoteDef
|
|
|
|
"hi def link markdownFootnoteDefHead markdownDelimiter
|
|
|
|
"syn match markdownFootnoteDefTail /\]/ contained containedin=markdownFootnoteDef
|
|
|
|
"hi def link markdownFootnoteDefTail markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
" regular footnotes
|
2024-02-14 15:13:12 +01:00
|
|
|
"syn region markdownFootnoteBlock start=/\[\^.\{-}\]:\s*\n*/ end=/^\n^\s\@!/ contains=markdownLink,markdownLatex,markdownPCite,markdownCiteKey,markdownBold,markdownItalic,markdownNoFormatted,markdownSuperscript,markdownSubscript,markdownStrike,markdownEnDash,markdownEmDash,markdownNewLine,markdownBoldItalic,markdownEllipses,markdownBeginQuote,markdownEndQuote,markdownLaTeXInlineMath,markdownEscapedDollar,markdownLaTeXCommand,markdownLaTeXMathBlock,markdownLaTeXRegion,markdownAmpersandEscape,@Spell skipnl
|
|
|
|
"syn match markdownFootnoteBlockSeparator /:/ contained containedin=markdownFootnoteBlock
|
|
|
|
"hi def link markdownFootnoteBlockSeparator markdownDelimiter
|
|
|
|
"syn match markdownFootnoteID /\[\^.\{-}\]/ contained containedin=markdownFootnoteBlock
|
|
|
|
"syn match markdownFootnoteIDHead /\[\^/ contained containedin=markdownFootnoteID
|
|
|
|
"hi def link markdownFootnoteIDHead markdownDelimiter
|
|
|
|
"syn match markdownFootnoteIDTail /\]/ contained containedin=markdownFootnoteID
|
|
|
|
"hi def link markdownFootnoteIDTail markdownDelimiter
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" 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
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" emphasis
|
|
|
|
syn region markdownItalic matchgroup=markdownDelimiter start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell
|
|
|
|
syn region markdownItalic matchgroup=markdownDelimiter start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@1<=_\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell
|
|
|
|
hi def link markdownItalic htmlItalic
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" bold
|
|
|
|
syn region markdownBold matchgroup=markdownDelimiter start=/\(\\\@<!\*\)\{2}/ end=/\(\\\@<!\*\)\{2}/ contains=@Spell
|
|
|
|
syn region markdownBold matchgroup=markdownDelimiter start=/__/ end=/__/ contains=@Spell
|
|
|
|
hi def link markdownBold htmlBold
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" bold italic
|
|
|
|
syn region markdownBoldItalic matchgroup=markdownDelimiter start=/\*\{3}\(\S[^*]*\(\*\S\|\n[^*]*\*\S\)\)\@=/ end=/\S\@<=\*\{3}/ contains=@Spell
|
|
|
|
syn region markdownBoldItalic matchgroup=markdownDelimiter start=/\(___\)\S\@=/ end=/\S\@<=___/ contains=@Spell
|
|
|
|
hi def link markdownBoldItalic htmlBoldItalic
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
syn region markdownBoldInItalic matchgroup=markdownDelimiter start=/\*\*/ end=/\*\*/ contained containedin=markdownItalic contains=@Spell
|
|
|
|
syn region markdownBoldInItalic matchgroup=markdownDelimiter start=/__/ end=/__/ contained containedin=markdownItalic contains=@Spell
|
|
|
|
hi def link markdownBoldInItalic markdownBoldItalic
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
syn region markdownItalicInBold matchgroup=markdownDelimiter start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=\*\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=markdownBold contains=@Spell
|
|
|
|
syn region markdownItalicInBold matchgroup=markdownDelimiter start=/\\\@<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=markdownBold contains=@Spell
|
|
|
|
hi def link markdownItalicInBold markdownBoldItalic
|
|
|
|
|
|
|
|
" link
|
|
|
|
syn match markdownLink /!\=\[\_.\{-}\](\_.\{-})/ contains=markdownLinkLabel,markdownLinkURL
|
|
|
|
syn match markdownLinkLabel /\[\zs.*\ze\]/ contained
|
|
|
|
hi def link markdownLinkLabel markdownLabel
|
|
|
|
syn match markdownLinkURL /.*(\zs.*\ze)/ contained
|
|
|
|
hi def link markdownLinkURL markdownUnderlined
|
|
|
|
|
|
|
|
" automatic link
|
|
|
|
syn match markdownAutomaticLink /<\(https\{0,1}.\{-}\|[A-Za-z0-9!#$%&'*+\-/=?^_`{|}~.]\{-}@[A-Za-z0-9\-]\{-}\.\w\{-}\)>/
|
|
|
|
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
|
2024-01-27 21:12:38 +01:00
|
|
|
|
2024-02-14 15:13:12 +01:00
|
|
|
" styling
|
2024-01-27 21:12:38 +01:00
|
|
|
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
|
2024-02-11 10:25:16 +01:00
|
|
|
hi def link markdownError Error
|
2024-01-27 21:12:38 +01:00
|
|
|
|
|
|
|
hi def link markdownItalic htmlItalic
|
|
|
|
hi def link markdownBold htmlBold
|
|
|
|
hi def link markdownItalicBold htmlItalicBold
|
|
|
|
hi def link markdownStrike htmlStrike
|
|
|
|
hi def link markdownTitle Title
|
|
|
|
|
|
|
|
let b:current_syntax = "markdown"
|
|
|
|
|
|
|
|
" vim:set sw=2:
|