1"SiSU Vim syntax file 2"SiSU Maintainer: Ralph Amissah <[email protected]> 3"SiSU Markup: SiSU (sisu-2.0.1, 2010-03-17) 4"(originally looked at Ruby Vim by Mirko Nasato) 5 6if version < 600 7 syntax clear 8elseif exists("b:current_syntax") 9 finish 10else 11endif 12 13" Errors: 14syn match sisu_error contains=sisu_link,sisu_error_wspace "<![^ei]\S\+!>" 15 16" Markers Identifiers: 17if !exists("sisu_no_identifiers") 18 syn match sisu_mark_endnote "\~^" 19 syn match sisu_break contains=@NoSpell "<br>\|<br />" 20 syn match sisu_control contains=@NoSpell "<:p[bn]>" 21 syn match sisu_marktail "[~-]#" 22 syn match sisu_control "\"" 23 syn match sisu_underline "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)" 24 syn match sisu_number contains=@NoSpell "[0-9a-f]\{32\}\|[0-9a-f]\{64\}" 25 syn match sisu_link contains=@NoSpell "\(_\?https\?://\|\.\.\/\)\S\+" 26 syn match sisu_link " \*\~\S\+" 27 syn match sisu_action "^<:insert\d\+>" 28 syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$" 29 syn match sisu_require contains=@NoSpell "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$" 30 syn match sisu_structure "^:A\~$" 31 syn match sisu_sub_header_title "^\s\+:\(subtitle\|short\|edition\|language\|note\):\s" "group=sisu_header_content 32 syn match sisu_sub_header_creator "^\s\+:\(author\|translator\|illustrator\|photographer\|audio\|digitized_by\|prepared_by\):\s" 33 syn match sisu_sub_header_rights "^\s\+:\(copyright\|text\|translation\|illustrations\|photographs\|audio\|digitization\|license\|all\):\s" "access_rights license 34 syn match sisu_sub_header_classify "^\s\+:\(type\|subject\|topic_register\|keywords\|coverage\|relation\|format\|identifier\|isbn\|dewey\|loc\|pg\):\s" 35 syn match sisu_sub_header_dates "^\s\+:\(published\|available\|created\|issued\|valid\|modified\|added_to_site\|translated\|original_publication\):\s" 36 syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|institution\|nationality\|source\):\s" 37 syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|italics\|bold\|skin\|stamp\|promo\|ad\|manpage\):\s" 38 syn match sisu_sub_header_notes "^\s\+:\(comment\|abstract\|description\|history\|prefix\|prefix_[ab]\):\s" 39 syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]" 40 syn match sisu_sem_marker_block "\([a-z][a-z._]*\|\):{\|}:[a-z._]*[a-z]" 41 syn match sisu_sem_ex_marker ";\[\|\];[a-z._]*[a-z]" 42 syn match sisu_sem_ex_marker_block "\([a-z][a-z._]*\|\):\[\|\]:[a-z._]*[a-z]" 43 syn match sisu_sem_block contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_mark_endnote,sisu_content_endnote "\([a-z]*\):{[^}].\{-}}:\1" 44 syn match sisu_sem_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker ";{[^}].\{-}};[a-z]\+" 45 syn match sisu_sem_ex_block contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_mark_endnote,sisu_content_endnote "\([a-z]*\):\[[^}].\{-}\]:\1" 46 syn match sisu_sem_ex_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker ";\[[^}].\{-}\];[a-z]\+" 47endif 48 49"URLs Numbers And ASCII Codes: 50syn match sisu_number "\<\(0x\x\+\|0b[01]\+\|0\o\+\|0\.\d\+\|0\|[1-9][\.0-9_]*\)\>" 51syn match sisu_number "?\(\\M-\\C-\|\\c\|\\C-\|\\M-\)\=\(\\\o\{3}\|\\x\x\{2}\|\\\=\w\)" 52 53"Tuned Error: (is error if not already matched) 54syn match sisu_error contains=sisu_error "[\~/\*!_]{\|}[\~/\*!_]" 55syn match sisu_error contains=sisu_error "<a href\|</a>]" 56 57"Simple Paired Enclosed Markup: 58"url/link 59syn region sisu_link contains=sisu_error,sisu_error_wspace matchgroup=sisu_action start="^<<\s*|[a-zA-Z0-9^._-]\+|@|[a-zA-Z0-9^._-]\+|"rs=s+2 end="$" 60"header 61syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_title matchgroup=sisu_header start="^[@]title:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 62syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_creator matchgroup=sisu_header start="^[@]creator:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 63syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_rights matchgroup=sisu_header start="^[@]rights:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 64syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_classify matchgroup=sisu_header start="^[@]classify:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 65syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_dates matchgroup=sisu_header start="^[@]date:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 66syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 67syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_publisher matchgroup=sisu_header start="^[@]publisher:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 68syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_notes matchgroup=sisu_header start="^[@]notes:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 69syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_original matchgroup=sisu_header start="^[@]original:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 70syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_source matchgroup=sisu_header start="^[@]source:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 71syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_linked,sisu_sub_header_links matchgroup=sisu_header start="^[@]links:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 72"headings 73syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$" 74"grouped text 75syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table" 76syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$" 77syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(alt\|group\|poem\){" end="^}\(alt\|group\|poem\)" 78syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code" 79"endnotes 80syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker matchgroup=sisu_mark_endnote start="\~{[*+]*" end="}\~" skip="\n" 81syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker matchgroup=sisu_mark_endnote start="\~\[[*+]*" end="\]\~" skip="\n" 82syn region sisu_content_endnote contains=sisu_strikeout,sisu_number,sisu_control,sisu_link,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\^\~" end="\n$" 83"links and images 84syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="}\(https\?:/\/\|\.\./\)\S\+" oneline 85syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="\[[1-5][sS]*\]}\S\+\.ss[tm]" oneline 86syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{" end="}image" oneline 87"some line operations 88syn region sisu_control contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_error,sisu_error_wspace matchgroup=sisu_control start="\(\(^\| \)!_ \|<:b>\)" end="$" 89syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([1-9*]\|[1-9]\*\) " end="$" 90syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^\(#[ 1]\|_# \)" end="$" 91"font face curly brackets 92"syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline 93syn region sisu_index matchgroup=sisu_index_block start="^={" end="}" 94syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*" 95syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="!{" end="}!" 96syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="_{" end="}_" 97syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="/{" end="}/" 98syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="+{" end="}+" 99syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\^{" end="}\^" 100syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start=",{" end="}," 101syn region sisu_strikeout contains=sisu_error matchgroup=sisu_fontface start="-{" end="}-" 102syn region sisu_html contains=sisu_error contains=sisu_strikeout matchgroup=sisu_contain start="<a href=\".\{-}\">" end="</a>" oneline 103"single words bold italicise etc. "workon 104syn region sisu_control contains=sisu_error matchgroup=sisu_control start="\([ (]\|^\)\*[^\|{\n\~\\]"hs=e-1 end="\*"he=e-0 skip="[a-zA-Z0-9']" oneline 105syn region sisu_identifier contains=sisu_error matchgroup=sisu_content_alt start="\([ ]\|^\)/[^{ \|\n\\]"hs=e-1 end="/\[ \.\]" skip="[a-zA-Z0-9']" oneline 106"misc 107syn region sisu_identifier contains=sisu_error matchgroup=sisu_fontface start="\^[^ {\|\n\\]"rs=s+1 end="\^[ ,.;:'})\\\n]" skip="[a-zA-Z0-9']" oneline 108 109"Expensive Mode: 110if !exists("sisu_no_expensive") 111else " not Expensive 112 syn region sisu_content_alt matchgroup=sisu_control start="^\s*def\s" matchgroup=NONE end="[?!]\|\>" skip="\.\|\(::\)" oneline 113endif " Expensive? 114 115"Headers And Headings: (Document Instructions) 116syn match sisu_control contains=sisu_error,sisu_error_wspace "4\~! \S\+" 117syn region sisu_markpara contains=sisu_error,sisu_error_wspace start="^=begin" end="^=end.*$" 118 119"Errors: 120syn match sisu_error_wspace contains=sisu_error_wspace "^\s\+[^:]" 121syn match sisu_error_wspace contains=sisu_error_wspace "\s\s\+" 122syn match sisu_error_wspace contains=sisu_error_wspace " \s*$" 123syn match sisu_error contains=sisu_error_wspace "\t\+" 124syn match sisu_error contains=sisu_error,sisu_error_wspace "\([^ (][_\\]\||[^ (}]\)https\?:\S\+" 125syn match sisu_error contains=sisu_error "_\?https\?:\S\+[}><]" 126syn match sisu_error contains=sisu_error "\([!*/_\+,^]\){\([^(\}\1)]\)\{-}\n$" 127syn match sisu_error contains=sisu_error "^[\~]{[^{]\{-}\n$" 128syn match sisu_error contains=sisu_error "\s\+.{{" 129syn match sisu_error contains=sisu_error "^\~\s*$" 130syn match sisu_error contains=sisu_error "^0\~.*" 131syn match sisu_error contains=sisu_error "^[1-9]\~\s*$" 132syn match sisu_error contains=sisu_error "^[1-9]\~\S\+\s*$" 133syn match sisu_error contains=sisu_error "[^{]\~\^[^ \)]" 134syn match sisu_error contains=sisu_error "\~\^\s\+\.\s*" 135syn match sisu_error contains=sisu_error "{\~^\S\+" 136syn match sisu_error contains=sisu_error "[_/\*!^]{[ .,:;?><]*}[_/\*!^]" 137syn match sisu_error contains=sisu_error "[^ (\"'(\[][_/\*!]{\|}[_/\*!][a-zA-Z0-9)\]\"']" 138syn match sisu_error contains=sisu_error "<dir>" 139"errors for filetype sisu, though not error in 'metaverse': 140syn match sisu_error contains=sisu_error,sisu_match,sisu_strikeout,sisu_contain,sisu_content_alt,sisu_mark,sisu_break,sisu_number "<[a-zA-Z\/]\+>" 141syn match sisu_error "/\?<\([biu]\)>[^(</\1>)]\{-}\n$" 142 143"Error Exceptions: 144syn match sisu_control "\n$" "contains=ALL 145syn match sisu_control " //" 146syn match sisu_error "%{" 147syn match sisu_error "<br>_\?https\?:\S\+\|_\?https\?:\S\+<br>" 148syn match sisu_error "[><]_\?https\?:\S\+\|_\?https\?:\S\+[><]" 149syn match sisu_comment "^%\{1,2\}.\+" 150 151"Definitions Default Highlighting: 152hi def link sisu_normal Normal 153hi def link sisu_header PreProc 154hi def link sisu_header_content Normal 155hi def link sisu_sub_header_title Statement 156hi def link sisu_sub_header_creator Statement 157hi def link sisu_sub_header_rights Statement 158hi def link sisu_sub_header_classify Statement 159hi def link sisu_sub_header_dates Statement 160hi def link sisu_sub_header_make Statement 161hi def link sisu_sub_header_links Statement 162hi def link sisu_sub_header_publisher Statement 163hi def link sisu_sub_header_notes Statement 164hi def link sisu_sub_header_original Statement 165hi def link sisu_sub_header_source Statement 166hi def link sisu_heading Title 167hi def link sisu_structure Operator 168hi def link sisu_contain Include 169hi def link sisu_mark_endnote Include 170hi def link sisu_require NonText 171hi def link sisu_link NonText 172hi def link sisu_linked String 173hi def link sisu_fontface Include 174hi def link sisu_strikeout DiffDelete 175hi def link sisu_content_alt Special 176hi def link sisu_sem_content SpecialKey 177hi def link sisu_sem_block Special 178hi def link sisu_sem_marker Visual 179"hi def link sisu_sem_marker Structure 180hi def link sisu_sem_marker_block MatchParen 181hi def link sisu_sem_ex_marker FoldColumn 182hi def link sisu_sem_ex_marker_block Folded 183hi def link sisu_sem_ex_content Comment 184"hi def link sisu_sem_ex_content SpecialKey 185hi def link sisu_sem_ex_block Comment 186hi def link sisu_index SpecialKey 187hi def link sisu_index_block Visual 188hi def link sisu_content_endnote Special 189hi def link sisu_control Define 190hi def link sisu_ocn Include 191hi def link sisu_number Number 192hi def link sisu_identifier Function 193hi def link sisu_underline Underlined 194hi def link sisu_markpara Include 195hi def link sisu_marktail Include 196hi def link sisu_mark Identifier 197hi def link sisu_break Structure 198hi def link sisu_html Type 199hi def link sisu_action Identifier 200hi def link sisu_comment Comment 201hi def link sisu_error_sem_marker Error 202hi def link sisu_error_wspace Error 203hi def link sisu_error Error 204let b:current_syntax = "sisu" 205