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