1" SiSU Vim syntax file 2" SiSU Maintainer: Ralph Amissah <[email protected]> 3" SiSU Markup: SiSU (sisu-4.0.9) 4" Last Change: 2013-02-22 5" URL (sisu-4.1.0): <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD> 6"(originally looked at Ruby Vim by Mirko Nasato) 7 8if version < 600 9 syntax clear 10elseif exists("b:current_syntax") 11 finish 12else 13endif 14let s:cpo_save = &cpo 15set cpo&vim 16 17"% "Errors: 18syn match sisu_error contains=sisu_link,sisu_error_wspace "<![^ei]\S\+!>" 19 20"% "Markers Identifiers: 21if !exists("sisu_no_identifiers") 22 syn match sisu_mark_endnote "\~^" 23 syn match sisu_break contains=@NoSpell " \\\\\( \|$\)\|<br>\|<br />" 24 syn match sisu_control contains=@NoSpell "^\(-\\\\-\|=\\\\=\|-\.\.-\|<:p[bn]>\)\s*$" 25 syn match sisu_control contains=@NoSpell "^<:\(bo\|---\)>\s*$" 26 syn match sisu_marktail "[~-]#" 27 syn match sisu_control "\"" 28 syn match sisu_underline "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)" 29 syn match sisu_number contains=@NoSpell "[0-9a-f]\{32\}\|[0-9a-f]\{64\}" 30 syn match sisu_link contains=@NoSpell "\(_\?https\?://\|\.\.\/\)\S\+" 31 syn match sisu_link " \*\~\S\+" 32 syn match sisu_action "^<:insert\d\+>" 33 syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$" 34 syn match sisu_require contains=@NoSpell "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$" 35 syn match sisu_structure "^:A\~$" 36 37"% "Document Sub Headers: 38 syn match sisu_sub_header_title "^\s\+:\(subtitle\|short\|edition\|language\|lang_char\|note\):\s" "group=sisu_header_content 39 syn match sisu_sub_header_creator "^\s\+:\(author\|editor\|contributor\|illustrator\|photographer\|translator\|digitized_by\|prepared_by\|audio\|video\):\s" " &hon &institution 40 syn match sisu_sub_header_rights "^\s\+:\(copyright\|text\|translation\|illustrations\|photographs\|preparation\|digitization\|audio\|video\|license\|all\):\s" " access_rights license 41 syn match sisu_sub_header_classify "^\s\+:\(topic_register\|keywords\|subject\|dewey\|loc\):\s" 42 syn match sisu_sub_header_identifier "^\s\+:\(oclc\|isbn\):\s" 43 syn match sisu_sub_header_date "^\s\+:\(added_to_site\|available\|created\|issued\|modified\|published\|valid\|translated\|original_publication\):\s" 44 syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|lang_char\|institution\|nationality\|source\):\s" 45 syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|substitute\|omit\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|stamp\|promo\|ad\|manpage\|home_button_text\|home_button_image\|cover_image\|footer\):\s" 46 syn match sisu_sub_header_notes "^\s\+:\(description\|abstract\|comment\|coverage\|relation\|source\|history\|type\|format\|prefix\|prefix_[ab]\|suffix\):\s" 47 48"% "semantic markers: (ignore) 49 syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]" 50 syn match sisu_sem_marker_block "\([a-z][a-z._]*\|\):{\|}:[a-z._]*[a-z]" 51 syn match sisu_sem_ex_marker ";\[\|\];[a-z._]*[a-z]" 52 syn match sisu_sem_ex_marker_block "\([a-z][a-z._]*\|\):\[\|\]:[a-z._]*[a-z]" 53 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" 54 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]\+" 55 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" 56 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]\+" 57endif 58 59"% "URLs Numbers And ASCII Codes: 60syn match sisu_number "\<\(0x\x\+\|0b[01]\+\|0\o\+\|0\.\d\+\|0\|[1-9][\.0-9_]*\)\>" 61syn match sisu_number "?\(\\M-\\C-\|\\c\|\\C-\|\\M-\)\=\(\\\o\{3}\|\\x\x\{2}\|\\\=\w\)" 62 63"% "Tuned Error: (is error if not already matched) 64syn match sisu_error contains=sisu_error "[\~/\*!_]{\|}[\~/\*!_]" 65syn match sisu_error contains=sisu_error "<a href\|</a>]" 66 67"% "Simple Paired Enclosed Markup: 68"url/link 69syn 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="$" 70 71"% "Document Header: 72" title 73syn 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$" 74" creator 75syn 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$" 76" dates 77syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_date matchgroup=sisu_header start="^[@]date:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 78" publisher 79syn 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$" 80" rights 81syn 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$" 82" classify document 83syn 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$" 84" identifier document 85syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_identifier matchgroup=sisu_header start="^[@]identifier:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" 86" original language (depreciated) 87syn 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$" 88" notes 89syn 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$" 90" links of interest 91syn 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$" 92" make, processing instructions 93syn 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$" 94 95"% "Headings: 96syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$" 97 98"% "Block Group Text: 99" table 100syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table" 101" table 102syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$" 103" block, group, poem, alt 104syn 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="^\(block\|group\|poem\|alt\){" end="^}\(block\|group\|poem\|alt\)" 105" code 106syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code" 107 108"% "Endnotes: 109" regular endnote or asterisk or plus sign endnote 110syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_bold,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" 111" numbered asterisk or plus sign endnote 112syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_bold,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" 113" endnote content marker (for binary content marking) 114syn region sisu_content_endnote contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_link,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\^\~" end="\n$" 115 116"% "Links And Images: 117" image with url link (and possibly footnote of url) 118syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,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 119" sisu outputs, short notation 120syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,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 121" image 122syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{" end="}image" oneline 123 124"% "Some Line Operations: 125" bold line 126syn region sisu_bold contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^!_ " end=" \\\\\|$" 127" indent and bullet paragraph 128syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,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="$" 129" indent and bullet (bold start) paragraph 130syn region sisu_bold contains=sisu_fontface,sisu_bold,sisu_control,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=" \\\\\|$" 131" hanging indent paragraph [proposed] 132syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,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="^_[0-9]\?_[0-9] " end="$" 133" hanging indent (bold start/ definition) paragraph [proposed] 134syn region sisu_bold contains=sisu_fontface,sisu_bold,sisu_control,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="^_[0-9]\?_[0-9]!_\? " end=" \\\\\|$" 135" list numbering 136syn 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="$" 137 138"% "Font Face Curly Brackets: 139"syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline 140" book index: 141syn region sisu_index matchgroup=sisu_index_block start="^={" end="}" 142" emphasis: 143syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*" 144" bold: 145syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="!{" end="}!" 146" underscore: 147syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="_{" end="}_" 148" italics: 149syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="/{" end="}/" 150" added: 151syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="+{" end="}+" 152" superscript: 153syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\^{" end="}\^" 154" subscript: 155syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start=",{" end="}," 156" monospace: 157syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="#{" end="}#" 158" strikethrough: 159syn region sisu_strikeout contains=sisu_error matchgroup=sisu_fontface start="-{" end="}-" 160 161"% "Single Words Bold Italicise Etc: (depreciated) 162syn region sisu_bold contains=sisu_error matchgroup=sisu_bold start="\([ (]\|^\)\*[^\|{\n\~\\]"hs=e-1 end="\*"he=e-0 skip="[a-zA-Z0-9']" oneline 163syn region sisu_identifier contains=sisu_error matchgroup=sisu_content_alt start="\([ ]\|^\)/[^{ \|\n\\]"hs=e-1 end="/\[ \.\]" skip="[a-zA-Z0-9']" oneline 164"misc 165syn region sisu_identifier contains=sisu_error matchgroup=sisu_fontface start="\^[^ {\|\n\\]"rs=s+1 end="\^[ ,.;:'})\\\n]" skip="[a-zA-Z0-9']" oneline 166 167"% "Expensive Mode: 168if !exists("sisu_no_expensive") 169else " not Expensive 170 syn region sisu_content_alt matchgroup=sisu_control start="^\s*def\s" matchgroup=NONE end="[?!]\|\>" skip="\.\|\(::\)" oneline 171endif " Expensive? 172 173"% "Headers And Headings: (Document Instructions) 174syn match sisu_control contains=sisu_error,sisu_error_wspace "4\~! \S\+" 175syn region sisu_markpara contains=sisu_error,sisu_error_wspace start="^=begin" end="^=end.*$" 176 177"% "Errors: 178syn match sisu_error_wspace contains=sisu_error_wspace "^\s\+[^:]" 179syn match sisu_error_wspace contains=sisu_error_wspace "\s\s\+" 180syn match sisu_error_wspace contains=sisu_error_wspace "\s\+$" 181syn match sisu_error contains=sisu_error_wspace "\t\+" 182syn match sisu_error contains=sisu_error,sisu_error_wspace "\([^ (][_\\]\||[^ (}]\)https\?:\S\+" 183syn match sisu_error contains=sisu_error "_\?https\?:\S\+[}><]" 184syn match sisu_error contains=sisu_error "\([!*/_\+,^]\){\([^(\}\1)]\)\{-}\n$" 185syn match sisu_error contains=sisu_error "^[\~]{[^{]\{-}\n$" 186syn match sisu_error contains=sisu_error "\s\+.{{" 187syn match sisu_error contains=sisu_error "^\~\s*$" 188syn match sisu_error contains=sisu_error "^0\~.*" 189syn match sisu_error contains=sisu_error "^[1-9]\~\s*$" 190syn match sisu_error contains=sisu_error "^[1-9]\~\S\+\s*$" 191syn match sisu_error contains=sisu_error "[^{]\~\^[^ \)]" 192syn match sisu_error contains=sisu_error "\~\^\s\+\.\s*" 193syn match sisu_error contains=sisu_error "{\~^\S\+" 194syn match sisu_error contains=sisu_error "[_/\*!^]{[ .,:;?><]*}[_/\*!^]" 195syn match sisu_error contains=sisu_error "[^ (\"'(\[][_/\*!]{\|}[_/\*!][a-zA-Z0-9)\]\"']" 196syn match sisu_error contains=sisu_error "<dir>" 197"errors for filetype sisu, though not error in 'metaverse': 198syn match sisu_error contains=sisu_error,sisu_match,sisu_strikeout,sisu_contain,sisu_content_alt,sisu_mark,sisu_break,sisu_number "<[a-zA-Z\/]\+>" 199syn match sisu_error "/\?<\([biu]\)>[^(</\1>)]\{-}\n$" 200 201"% "Error Exceptions: 202syn match sisu_control "\n$" "contains=ALL 203"syn match sisu_control " //" 204syn match sisu_error "%{" 205syn match sisu_error "<br>_\?https\?:\S\+\|_\?https\?:\S\+<br>" 206syn match sisu_error "[><]_\?https\?:\S\+\|_\?https\?:\S\+[><]" 207syn match sisu_comment "^%\{1,2\}.\+" 208 209"% "Definitions Default Highlighting: 210hi def link sisu_normal Normal 211hi def link sisu_bold Statement 212hi def link sisu_header PreProc 213hi def link sisu_header_content Normal 214hi def link sisu_sub_header_title Statement 215hi def link sisu_sub_header_creator Statement 216hi def link sisu_sub_header_date Statement 217hi def link sisu_sub_header_publisher Statement 218hi def link sisu_sub_header_rights Statement 219hi def link sisu_sub_header_classify Statement 220hi def link sisu_sub_header_identifier Statement 221hi def link sisu_sub_header_original Statement 222hi def link sisu_sub_header_links Statement 223hi def link sisu_sub_header_notes Statement 224hi def link sisu_sub_header_make Statement 225hi def link sisu_heading Title 226hi def link sisu_structure Operator 227hi def link sisu_contain Include 228hi def link sisu_mark_endnote Delimiter 229hi def link sisu_require NonText 230hi def link sisu_link NonText 231hi def link sisu_linked String 232hi def link sisu_fontface Delimiter 233hi def link sisu_strikeout DiffDelete 234hi def link sisu_content_alt Special 235hi def link sisu_sem_content SpecialKey 236hi def link sisu_sem_block Special 237hi def link sisu_sem_marker Visual 238"hi def link sisu_sem_marker Structure 239hi def link sisu_sem_marker_block MatchParen 240hi def link sisu_sem_ex_marker FoldColumn 241hi def link sisu_sem_ex_marker_block Folded 242hi def link sisu_sem_ex_content Comment 243"hi def link sisu_sem_ex_content SpecialKey 244hi def link sisu_sem_ex_block Comment 245hi def link sisu_index SpecialKey 246hi def link sisu_index_block Visual 247hi def link sisu_content_endnote Special 248hi def link sisu_control Delimiter 249hi def link sisu_ocn Include 250hi def link sisu_number Number 251hi def link sisu_identifier Function 252hi def link sisu_underline Underlined 253hi def link sisu_markpara Include 254hi def link sisu_marktail Include 255hi def link sisu_mark Identifier 256hi def link sisu_break Structure 257hi def link sisu_html Type 258hi def link sisu_action Identifier 259hi def link sisu_comment Comment 260hi def link sisu_error_sem_marker Error 261hi def link sisu_error_wspace Error 262hi def link sisu_error Error 263let b:current_syntax = "sisu" 264let &cpo = s:cpo_save 265unlet s:cpo_save 266