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