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