Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
asciidoc.vim186 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:        AsciiDoc3" Maintainer:      @aerostitch on GitHub (tag me in your issue in the4"                  github/vim/vim repository and I'll answer when available)5" Original author: Stuart Rackham <srackham@gmail.com> (inspired by Felix6"                  Obenhuber's original asciidoc.vim script).7" URL:             http://asciidoc.org/8" Licence:         GPL (http://www.gnu.org)9" Remarks:         Vim 6 or greater10" Last Update:     2020 May 03 (see Issue 240)11" Limitations:12"13" - Nested quoted text formatting is highlighted according to the outer14"   format.15" - If a closing Example Block delimiter may be mistaken for a title16"   underline. A workaround is to insert a blank line before the closing17"   delimiter.18" - Lines within a paragraph starting with equals characters are19"   highlighted as single-line titles.20" - Lines within a paragraph beginning with a period are highlighted as21"   block titles.22 23 24if exists("b:current_syntax")25  finish26endif27 28" Use the default syntax syncing.29 30" Run :help syn-priority to review syntax matching priority.31syn keyword asciidocToDo TODO FIXME CHECK TEST XXX ZZZ DEPRECATED32syn match asciidocBackslash /\\/33syn region asciidocIdMarker start=/^\$Id:\s/ end=/\s\$$/34syn match asciidocCallout /\\\@<!<\d\{1,2}>/35syn match asciidocOpenBlockDelimiter /^--$/36syn match asciidocLineBreak /[ \t]+$/ containedin=asciidocList37syn match asciidocRuler /^'\{3,}$/38syn match asciidocPagebreak /^<\{3,}$/39syn match asciidocEntityRef /\\\@<!&[#a-zA-Z]\S\{-};/40syn region asciidocLiteralParagraph start=/\(\%^\|\_^\s*\n\)\@<=\s\+\S\+/ end=/\(^\(+\|--\)\?\s*$\)\@=/ contains=asciidocToDo41syn match asciidocURL /\\\@<!\<\(http\|https\|ftp\|file\|irc\):\/\/[^| \t]*\(\w\|\/\)/42syn match asciidocEmail /[\\.:]\@<!\(\<\|<\)\w\(\w\|[.-]\)*@\(\w\|[.-]\)*\w>\?[0-9A-Za-z_]\@!/43syn match asciidocAttributeRef /\\\@<!{\w\(\w\|[-,+]\)*\([=!@#$%?:].*\)\?}/44 45" As a damage control measure quoted patterns always terminate at a blank46" line (see 'Limitations' above).47syn match asciidocQuotedAttributeList /\\\@<!\[[a-zA-Z0-9_-][a-zA-Z0-9 _-]*\][+_'`#*]\@=/48syn match asciidocQuotedSubscript /\\\@<!\~\S\_.\{-}\(\~\|\n\s*\n\)/ contains=asciidocEntityRef49syn match asciidocQuotedSuperscript /\\\@<!\^\S\_.\{-}\(\^\|\n\s*\n\)/ contains=asciidocEntityRef50 51syn match asciidocQuotedMonospaced /\(^\|[| \t([.,=\]]\)\@<=+\([+ \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(+\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef52syn match asciidocQuotedMonospaced2 /\(^\|[| \t([.,=\]]\)\@<=`\([` \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(`\([| \t)[\],.?!;:=]\|$\)\@=\)/53syn match asciidocQuotedUnconstrainedMonospaced /[\\+]\@<!++\S\_.\{-}\(++\|\n\s*\n\)/ contains=asciidocEntityRef54 55syn match asciidocQuotedEmphasized /\(^\|[| \t([.,=\]]\)\@<=_\([_ \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(_\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef56syn match asciidocQuotedEmphasized2 /\(^\|[| \t([.,=\]]\)\@<='\([' \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\('\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef57syn match asciidocQuotedUnconstrainedEmphasized /\\\@<!__\S\_.\{-}\(__\|\n\s*\n\)/ contains=asciidocEntityRef58 59syn match asciidocQuotedBold /\(^\|[| \t([.,=\]]\)\@<=\*\([* \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(\*\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef60syn match asciidocQuotedUnconstrainedBold /\\\@<!\*\*\S\_.\{-}\(\*\*\|\n\s*\n\)/ contains=asciidocEntityRef61 62" Don't allow ` in single quoted (a kludge to stop confusion with `monospaced`).63syn match asciidocQuotedSingleQuoted /\(^\|[| \t([.,=\]]\)\@<=`\([` \n\t]\)\@!\([^`]\|\n\(\s*\n\)\@!\)\{-}[^` \t]\('\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef64 65syn match asciidocQuotedDoubleQuoted /\(^\|[| \t([.,=\]]\)\@<=``\([` \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(''\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef66 67syn match asciidocDoubleDollarPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=\$\$..\{-}\(\$\$\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/68syn match asciidocTriplePlusPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=+++..\{-}\(+++\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/69 70syn match asciidocAdmonition /^\u\{3,15}:\(\s\+.*\)\@=/71 72syn region asciidocTable_OLD start=/^\([`.']\d*[-~_]*\)\+[-~_]\+\d*$/ end=/^$/73syn match asciidocBlockTitle /^\.[^. \t].*[^-~_]$/ contains=asciidocQuoted.*,asciidocAttributeRef74syn match asciidocTitleUnderline /[-=~^+]\{2,}$/ transparent contained contains=NONE75syn match asciidocOneLineTitle /^=\{1,5}\s\+\S.*$/ contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash76syn match asciidocTwoLineTitle /^[^. +/].*[^.]\n[-=~^+]\{3,}$/ contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocTitleUnderline77 78syn match asciidocAttributeList /^\[[^[ \t].*\]$/79syn match asciidocQuoteBlockDelimiter /^_\{4,}$/80syn match asciidocExampleBlockDelimiter /^=\{4,}$/81syn match asciidocSidebarDelimiter /^*\{4,}$/82 83" See http://vimdoc.sourceforge.net/htmldoc/usr_44.html for excluding region84" contents from highlighting.85syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?|/ containedin=asciidocTableBlock contained86syn region asciidocTableBlock matchgroup=asciidocTableDelimiter start=/^|=\{3,}$/ end=/^|=\{3,}$/ keepend contains=ALL87syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?!/ containedin=asciidocTableBlock contained88syn region asciidocTableBlock2 matchgroup=asciidocTableDelimiter2 start=/^!=\{3,}$/ end=/^!=\{3,}$/ keepend contains=ALL89 90syn match asciidocListContinuation /^+$/91syn region asciidocLiteralBlock start=/^\.\{4,}$/ end=/^\.\{4,}$/ contains=asciidocCallout,asciidocToDo keepend92syn region asciidocListingBlock start=/^-\{4,}$/ end=/^-\{4,}$/ contains=asciidocCallout,asciidocToDo keepend93syn region asciidocCommentBlock start="^/\{4,}$" end="^/\{4,}$" contains=asciidocToDo94syn region asciidocPassthroughBlock start="^+\{4,}$" end="^+\{4,}$"95 96" Allowing leading \w characters in the filter delimiter is to accomodate97" the pre version 8.2.7 syntax and may be removed in future releases.98syn region asciidocFilterBlock start=/^\w*\~\{4,}$/ end=/^\w*\~\{4,}$/99 100syn region asciidocMacroAttributes matchgroup=asciidocRefMacro start=/\\\@<!<<"\{-}\(\w\|-\|_\|:\|\.\)\+"\?,\?/ end=/\(>>\)\|^$/ contains=asciidocQuoted.* keepend101syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{2}\(\w\|-\|_\|:\|\.\)\+,\?/ end=/\]\{2}/ keepend102syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{3}\(\w\|-\|_\|:\|\.\)\+/ end=/\]\{3}/ keepend103syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/[\\0-9a-zA-Z]\@<!\w\(\w\|-\)*:\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted.*,asciidocAttributeRef,asciidocEntityRef keepend104" Highlight macro that starts with an attribute reference (a common idiom).105syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/\(\\\@<!{\w\(\w\|[-,+]\)*\([=!@#$%?:].*\)\?}\)\@<=\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted.*,asciidocAttributeRef keepend106syn region asciidocMacroAttributes matchgroup=asciidocIndexTerm start=/\\\@<!(\{2,3}/ end=/)\{2,3}/ contains=asciidocQuoted.*,asciidocAttributeRef keepend107 108syn match asciidocCommentLine "^//\([^/].*\|\)$" contains=asciidocToDo109 110syn region asciidocAttributeEntry start=/^:\w/ end=/:\(\s\|$\)/ oneline111 112" Lists.113syn match asciidocListBullet /^\s*\zs\(-\|\*\{1,5}\)\ze\s/114syn match asciidocListNumber /^\s*\zs\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\ze\s\+/115syn region asciidocListLabel start=/^\s*/ end=/\(:\{2,4}\|;;\)$/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocToDo keepend116" DEPRECATED: Horizontal label.117syn region asciidocHLabel start=/^\s*/ end=/\(::\|;;\)\(\s\+\|\\$\)/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes keepend118" Starts with any of the above.119syn region asciidocList start=/^\s*\(-\|\*\{1,5}\)\s/ start=/^\s*\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\s\+/ start=/.\+\(:\{2,4}\|;;\)$/ end=/\(^[=*]\{4,}$\)\@=/ end=/\(^\(+\|--\)\?\s*$\)\@=/ contains=asciidocList.\+,asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocCommentLine,asciidocAttributeList,asciidocToDo120 121hi def link asciidocAdmonition Special122hi def link asciidocAnchorMacro Macro123hi def link asciidocAttributeEntry Special124hi def link asciidocAttributeList Special125hi def link asciidocAttributeMacro Macro126hi def link asciidocAttributeRef Special127hi def link asciidocBackslash Special128hi def link asciidocBlockTitle Title129hi def link asciidocCallout Label130hi def link asciidocCommentBlock Comment131hi def link asciidocCommentLine Comment132hi def link asciidocDoubleDollarPassthrough Special133hi def link asciidocEmail Macro134hi def link asciidocEntityRef Special135hi def link asciidocExampleBlockDelimiter Type136hi def link asciidocFilterBlock Type137hi def link asciidocHLabel Label138hi def link asciidocIdMarker Special139hi def link asciidocIndexTerm Macro140hi def link asciidocLineBreak Special141hi def link asciidocOpenBlockDelimiter Label142hi def link asciidocListBullet Label143hi def link asciidocListContinuation Label144hi def link asciidocListingBlock Identifier145hi def link asciidocListLabel Label146hi def link asciidocListNumber Label147hi def link asciidocLiteralBlock Identifier148hi def link asciidocLiteralParagraph Identifier149hi def link asciidocMacroAttributes Label150hi def link asciidocMacro Macro151hi def link asciidocOneLineTitle Title152hi def link asciidocPagebreak Type153hi def link asciidocPassthroughBlock Identifier154hi def link asciidocQuoteBlockDelimiter Type155hi def link asciidocQuotedAttributeList Special156hi def link asciidocQuotedBold Special157hi def link asciidocQuotedDoubleQuoted Label158hi def link asciidocQuotedEmphasized2 Type159hi asciidocQuotedEmphasizedItalic term=italic cterm=italic gui=italic160hi def link asciidocQuotedEmphasized asciidocQuotedEmphasizedItalic161hi def link asciidocQuotedMonospaced2 Identifier162hi def link asciidocQuotedMonospaced Identifier163hi def link asciidocQuotedSingleQuoted Label164hi def link asciidocQuotedSubscript Type165hi def link asciidocQuotedSuperscript Type166hi def link asciidocQuotedUnconstrainedBold Special167hi def link asciidocQuotedUnconstrainedEmphasized Type168hi def link asciidocQuotedUnconstrainedMonospaced Identifier169hi def link asciidocRefMacro Macro170hi def link asciidocRuler Type171hi def link asciidocSidebarDelimiter Type172hi def link asciidocTableBlock2 NONE173hi def link asciidocTableBlock NONE174hi def link asciidocTableDelimiter2 Label175hi def link asciidocTableDelimiter Label176hi def link asciidocTable_OLD Type177hi def link asciidocTablePrefix2 Label178hi def link asciidocTablePrefix Label179hi def link asciidocToDo Todo180hi def link asciidocTriplePlusPassthrough Special181hi def link asciidocTwoLineTitle Title182hi def link asciidocURL Macro183let b:current_syntax = "asciidoc"184 185" vim: wrap et sw=2 sts=2:186 
codekingpro/portable-devtools · Team Ai