2 " Language: Vim help file
3 " Maintainer: Bram Moolenaar (Bram@vim.org)
4 " Last Change: 2006 May 13
6 " Quit when a (custom) syntax file was already loaded
7 if exists("b:current_syntax")
11 syn match helpHeadline "^[-A-Z .]\+[ \t]\+\*"me=e-1
12 syn match helpSectionDelim "^=\{3,}.*===$"
13 syn match helpSectionDelim "^-\{3,}.*--$"
14 syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
16 syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
17 syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
18 syn match helpHyperTextEntry "\*[^"*|]\+\*$" contains=helpStar
20 syn match helpHyperTextJump "\\\@<!|[#-)!+-~]\+|" contains=helpBar
21 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*\s"he=e-1 contains=helpStar
22 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*$" contains=helpStar
24 syn match helpBar contained "|"
25 syn match helpStar contained "\*"
26 syn match helpNormal "|.*====*|"
27 syn match helpNormal ":|vim:|" " for :help modeline
28 syn match helpVim "Vim version [0-9.a-z]\+"
29 syn match helpVim "VIM REFERENCE.*"
30 syn match helpOption "'[a-z]\{2,\}'"
31 syn match helpOption "'t_..'"
32 syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
33 syn match helpIgnore "." contained
34 syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
35 syn match helpSpecial "\<N\>"
36 syn match helpSpecial "\<N\.$"me=e-1
37 syn match helpSpecial "\<N\.\s"me=e-2
38 syn match helpSpecial "(N\>"ms=s+1
39 syn match helpSpecial "\[N]"
40 " avoid highlighting N N in help.txt
41 syn match helpSpecial "N N"he=s+1
42 syn match helpSpecial "Nth"me=e-2
43 syn match helpSpecial "N-1"me=e-2
44 syn match helpSpecial "{[-a-zA-Z0-9'":%#=[\]<>.,]\+}"
45 syn match helpSpecial "{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}"
46 syn match helpSpecial "\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1
47 syn match helpSpecial "<[-a-zA-Z0-9_]\+>"
48 syn match helpSpecial "<[SCM]-.>"
49 syn match helpNormal "<---*>"
50 syn match helpSpecial "\[range]"
51 syn match helpSpecial "\[line]"
52 syn match helpSpecial "\[count]"
53 syn match helpSpecial "\[offset]"
54 syn match helpSpecial "\[cmd]"
55 syn match helpSpecial "\[num]"
56 syn match helpSpecial "\[+num]"
57 syn match helpSpecial "\[-num]"
58 syn match helpSpecial "\[+cmd]"
59 syn match helpSpecial "\[++opt]"
60 syn match helpSpecial "\[arg]"
61 syn match helpSpecial "\[arguments]"
62 syn match helpSpecial "\[ident]"
63 syn match helpSpecial "\[addr]"
64 syn match helpSpecial "\[group]"
65 syn match helpSpecial "CTRL-."
66 syn match helpSpecial "CTRL-Break"
67 syn match helpSpecial "CTRL-PageUp"
68 syn match helpSpecial "CTRL-PageDown"
69 syn match helpSpecial "CTRL-Insert"
70 syn match helpSpecial "CTRL-Del"
71 syn match helpSpecial "CTRL-{char}"
72 syn region helpNotVi start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump
73 syn match helpLeadBlank "^\s\+" contained
75 " Highlight group items in their own color.
76 syn match helpComment "\t[* ]Comment\t\+[a-z].*"
77 syn match helpConstant "\t[* ]Constant\t\+[a-z].*"
78 syn match helpString "\t[* ]String\t\+[a-z].*"
79 syn match helpCharacter "\t[* ]Character\t\+[a-z].*"
80 syn match helpNumber "\t[* ]Number\t\+[a-z].*"
81 syn match helpBoolean "\t[* ]Boolean\t\+[a-z].*"
82 syn match helpFloat "\t[* ]Float\t\+[a-z].*"
83 syn match helpIdentifier "\t[* ]Identifier\t\+[a-z].*"
84 syn match helpFunction "\t[* ]Function\t\+[a-z].*"
85 syn match helpStatement "\t[* ]Statement\t\+[a-z].*"
86 syn match helpConditional "\t[* ]Conditional\t\+[a-z].*"
87 syn match helpRepeat "\t[* ]Repeat\t\+[a-z].*"
88 syn match helpLabel "\t[* ]Label\t\+[a-z].*"
89 syn match helpOperator "\t[* ]Operator\t\+["a-z].*"
90 syn match helpKeyword "\t[* ]Keyword\t\+[a-z].*"
91 syn match helpException "\t[* ]Exception\t\+[a-z].*"
92 syn match helpPreProc "\t[* ]PreProc\t\+[a-z].*"
93 syn match helpInclude "\t[* ]Include\t\+[a-z].*"
94 syn match helpDefine "\t[* ]Define\t\+[a-z].*"
95 syn match helpMacro "\t[* ]Macro\t\+[a-z].*"
96 syn match helpPreCondit "\t[* ]PreCondit\t\+[a-z].*"
97 syn match helpType "\t[* ]Type\t\+[a-z].*"
98 syn match helpStorageClass "\t[* ]StorageClass\t\+[a-z].*"
99 syn match helpStructure "\t[* ]Structure\t\+[a-z].*"
100 syn match helpTypedef "\t[* ]Typedef\t\+[Aa-z].*"
101 syn match helpSpecial "\t[* ]Special\t\+[a-z].*"
102 syn match helpSpecialChar "\t[* ]SpecialChar\t\+[a-z].*"
103 syn match helpTag "\t[* ]Tag\t\+[a-z].*"
104 syn match helpDelimiter "\t[* ]Delimiter\t\+[a-z].*"
105 syn match helpSpecialComment "\t[* ]SpecialComment\t\+[a-z].*"
106 syn match helpDebug "\t[* ]Debug\t\+[a-z].*"
107 syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
108 syn match helpError "\t[* ]Error\t\+[a-z].*"
109 syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
111 syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]`
113 " Additionally load a language-specific syntax file "help_ab.vim".
114 let s:i = match(expand("%"), '\.\a\ax$')
116 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
122 " Define the default highlighting.
123 " Only used when an item doesn't have highlighting yet
124 hi def link helpExampleStart helpIgnore
125 hi def link helpIgnore Ignore
126 hi def link helpHyperTextJump Subtitle
127 hi def link helpBar Ignore
128 hi def link helpStar Ignore
129 hi def link helpHyperTextEntry String
130 hi def link helpHeadline Statement
131 hi def link helpHeader PreProc
132 hi def link helpSectionDelim PreProc
133 hi def link helpVim Identifier
134 hi def link helpExample Comment
135 hi def link helpOption Type
136 hi def link helpNotVi Special
137 hi def link helpSpecial Special
138 hi def link helpNote Todo
139 hi def link Subtitle Identifier
141 hi def link helpComment Comment
142 hi def link helpConstant Constant
143 hi def link helpString String
144 hi def link helpCharacter Character
145 hi def link helpNumber Number
146 hi def link helpBoolean Boolean
147 hi def link helpFloat Float
148 hi def link helpIdentifier Identifier
149 hi def link helpFunction Function
150 hi def link helpStatement Statement
151 hi def link helpConditional Conditional
152 hi def link helpRepeat Repeat
153 hi def link helpLabel Label
154 hi def link helpOperator Operator
155 hi def link helpKeyword Keyword
156 hi def link helpException Exception
157 hi def link helpPreProc PreProc
158 hi def link helpInclude Include
159 hi def link helpDefine Define
160 hi def link helpMacro Macro
161 hi def link helpPreCondit PreCondit
162 hi def link helpType Type
163 hi def link helpStorageClass StorageClass
164 hi def link helpStructure Structure
165 hi def link helpTypedef Typedef
166 hi def link helpSpecialChar SpecialChar
167 hi def link helpTag Tag
168 hi def link helpDelimiter Delimiter
169 hi def link helpSpecialComment SpecialComment
170 hi def link helpDebug Debug
171 hi def link helpUnderlined Underlined
172 hi def link helpError Error
173 hi def link helpTodo Todo
174 hi def link helpURL String
176 let b:current_syntax = "help"