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