annotate runtime/syntax/flexwiki.vim @ 8277:fa1e3fa56104 v7.4.1431

commit https://github.com/vim/vim/commit/9e24f0c5c1b1097295d0619d95da66e6b2d83ac9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 27 17:22:27 2016 +0100 patch 7.4.1431 Problem: Including header files twice. Solution: Remove the extra includes.
author Christian Brabandt <cb@256bit.org>
date Sat, 27 Feb 2016 17:30:04 +0100
parents db44f7b81373
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
846
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
1 " Vim syntax file
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
2 " Language: FlexWiki, http://www.flexwiki.com/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
3 " Maintainer: George V. Reilly <george@reilly.org>
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
4 " Home: http://www.georgevreilly.com/vim/flexwiki/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
5 " Other Home: http://www.vim.org/scripts/script.php?script_id=1529
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
6 " Author: George V. Reilly
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
7 " Filenames: *.wiki
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
8 " Last Change: Wed Apr 26 11:00 PM 2006 P
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
9 " Version: 0.3
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
10
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
11 " Note: The horrible regexps were reverse-engineered from
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
12 " FlexWikiCore\EngineSource\Formatter.cs, with help from the Regex Analyzer
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
13 " in The Regulator, http://regulator.sourceforge.net/ .NET uses Perl-style
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
14 " regexes, which use a different syntax than Vim (fewer \s).
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
15 " The primary test case is FlexWiki\FormattingRules.wiki
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
16
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
17 " Quit if syntax file is already loaded
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
18 if version < 600
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
19 syntax clear
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
20 elseif exists("b:current_syntax")
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
21 finish
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
22 endif
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
23
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
24 " A WikiWord (unqualifiedWikiName)
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
25 syntax match flexwikiWord /\%(_\?\([A-Z]\{2,}[a-z0-9]\+[A-Za-z0-9]*\)\|\([A-Z][a-z0-9]\+[A-Za-z0-9]*[A-Z]\+[A-Za-z0-9]*\)\)/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
26 " A [bracketed wiki word]
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
27 syntax match flexwikiWord /\[[[:alnum:]\s]\+\]/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
28
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
29 " text: "this is a link (optional tooltip)":http://www.microsoft.com
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
30 " TODO: check URL syntax against RFC
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
31 syntax match flexwikiLink `\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)`
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
32
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
33 " text: *strong*
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
34 syntax match flexwikiBold /\(^\|\W\)\zs\*\([^ ].\{-}\)\*/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
35 " '''bold'''
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
36 syntax match flexwikiBold /'''\([^'].\{-}\)'''/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
37
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
38 " text: _emphasis_
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
39 syntax match flexwikiItalic /\(^\|\W\)\zs_\([^ ].\{-}\)_/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
40 " ''italic''
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
41 syntax match flexwikiItalic /''\([^'].\{-}\)''/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
42
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
43 " ``deemphasis``
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
44 syntax match flexwikiDeEmphasis /``\([^`].\{-}\)``/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
45
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
46 " text: @code@
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
47 syntax match flexwikiCode /\(^\|\s\|(\|\[\)\zs@\([^@]\+\)@/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
48
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
49 " text: -deleted text-
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
50 syntax match flexwikiDelText /\(^\|\s\+\)\zs-\([^ <a ]\|[^ <img ]\|[^ -].*\)-/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
51
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
52 " text: +inserted text+
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
53 syntax match flexwikiInsText /\(^\|\W\)\zs+\([^ ].\{-}\)+/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
54
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
55 " text: ^superscript^
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
56 syntax match flexwikiSuperScript /\(^\|\W\)\zs^\([^ ].\{-}\)^/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
57
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
58 " text: ~subscript~
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
59 syntax match flexwikiSubScript /\(^\|\W\)\zs\~\([^ ].\{-}\)\~/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
60
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
61 " text: ??citation??
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
62 syntax match flexwikiCitation /\(^\|\W\)\zs??\([^ ].\{-}\)??/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
63
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
64 " Emoticons: must come after the Textilisms, as later rules take precedence
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
65 " over earlier ones. This match is an approximation for the ~70 distinct
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
66 " patterns that FlexWiki knows.
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
67 syntax match flexwikiEmoticons /\((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
68
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
69 " Aggregate all the regular text highlighting into flexwikiText
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
70 syntax cluster flexwikiText contains=flexwikiItalic,flexwikiBold,flexwikiCode,flexwikiDeEmphasis,flexwikiDelText,flexwikiInsText,flexwikiSuperScript,flexwikiSubScript,flexwikiCitation,flexwikiLink,flexwikiWord,flexwikiEmoticons
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
71
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
72 " single-line WikiPropertys
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
73 syntax match flexwikiSingleLineProperty /^:\?[A-Z_][_a-zA-Z0-9]\+:/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
74
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
75 " TODO: multi-line WikiPropertys
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
76
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
77 " Header levels, 1-6
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
78 syntax match flexwikiH1 /^!.*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
79 syntax match flexwikiH2 /^!!.*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
80 syntax match flexwikiH3 /^!!!.*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
81 syntax match flexwikiH4 /^!!!!.*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
82 syntax match flexwikiH5 /^!!!!!.*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
83 syntax match flexwikiH6 /^!!!!!!.*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
84
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
85 " <hr>, horizontal rule
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
86 syntax match flexwikiHR /^----.*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
87
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
88 " Formatting can be turned off by ""enclosing it in pairs of double quotes""
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
89 syntax match flexwikiEscape /"".\{-}""/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
90
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
91 " Tables. Each line starts and ends with '||'; each cell is separated by '||'
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
92 syntax match flexwikiTable /||/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
93
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
94 " Bulleted list items start with one or tabs, followed by whitespace, then '*'
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
95 " Numeric list items start with one or tabs, followed by whitespace, then '1.'
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
96 " Eight spaces at the beginning of the line is equivalent to the leading tab.
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
97 syntax match flexwikiList /^\(\t\| \{8}\)\s*\(\*\|1\.\).*$/ contains=@flexwikiText
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
98
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
99 " Treat all other lines that start with spaces as PRE-formatted text.
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
100 syntax match flexwikiPre /^[ \t]\+[^ \t*1].*$/
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
101
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
102
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
103 " Link FlexWiki syntax items to colors
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
104 hi def link flexwikiH1 Title
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
105 hi def link flexwikiH2 flexwikiH1
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
106 hi def link flexwikiH3 flexwikiH2
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
107 hi def link flexwikiH4 flexwikiH3
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
108 hi def link flexwikiH5 flexwikiH4
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
109 hi def link flexwikiH6 flexwikiH5
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
110 hi def link flexwikiHR flexwikiH6
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
111
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
112 hi def flexwikiBold term=bold cterm=bold gui=bold
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
113 hi def flexwikiItalic term=italic cterm=italic gui=italic
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
114
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
115 hi def link flexwikiCode Statement
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
116 hi def link flexwikiWord Underlined
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
117
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
118 hi def link flexwikiEscape Todo
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
119 hi def link flexwikiPre PreProc
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
120 hi def link flexwikiLink Underlined
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
121 hi def link flexwikiList Type
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
122 hi def link flexwikiTable Type
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
123 hi def link flexwikiEmoticons Constant
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
124 hi def link flexwikiDelText Comment
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
125 hi def link flexwikiDeEmphasis Comment
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
126 hi def link flexwikiInsText Constant
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
127 hi def link flexwikiSuperScript Constant
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
128 hi def link flexwikiSubScript Constant
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
129 hi def link flexwikiCitation Constant
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
130
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
131 hi def link flexwikiSingleLineProperty Identifier
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
132
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
133 let b:current_syntax="FlexWiki"
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
134
db44f7b81373 updated for version 7.0f03
vimboss
parents:
diff changeset
135 " vim:tw=0: