xref: /vim-8.2.3635/runtime/syntax/help.vim (revision 5c73622a)
1071d4279SBram Moolenaar" Vim syntax file
2071d4279SBram Moolenaar" Language:	Vim help file
3071d4279SBram Moolenaar" Maintainer:	Bram Moolenaar ([email protected])
4*5c73622aSBram Moolenaar" Last Change:	2009 May 18
5071d4279SBram Moolenaar
6d857f0e0SBram Moolenaar" Quit when a (custom) syntax file was already loaded
7d857f0e0SBram Moolenaarif exists("b:current_syntax")
8071d4279SBram Moolenaar  finish
9071d4279SBram Moolenaarendif
10071d4279SBram Moolenaar
11*5c73622aSBram Moolenaarsyn match helpHeadline		"^[-A-Z .][-A-Z0-9 .()]*[ \t]\+\*"me=e-1
12071d4279SBram Moolenaarsyn match helpSectionDelim	"^=\{3,}.*===$"
13071d4279SBram Moolenaarsyn match helpSectionDelim	"^-\{3,}.*--$"
14071d4279SBram Moolenaarsyn region helpExample		matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
15071d4279SBram Moolenaarif has("ebcdic")
1618144c84SBram Moolenaar  syn match helpHyperTextJump	"\\\@<!|[^"*|]\+|" contains=helpBar
177fc904b6SBram Moolenaar  syn match helpHyperTextEntry	"\*[^"*|]\+\*\s"he=e-1 contains=helpStar
187fc904b6SBram Moolenaar  syn match helpHyperTextEntry	"\*[^"*|]\+\*$" contains=helpStar
19071d4279SBram Moolenaarelse
2018144c84SBram Moolenaar  syn match helpHyperTextJump	"\\\@<!|[#-)!+-~]\+|" contains=helpBar
217fc904b6SBram Moolenaar  syn match helpHyperTextEntry	"\*[#-)!+-~]\+\*\s"he=e-1 contains=helpStar
227fc904b6SBram Moolenaar  syn match helpHyperTextEntry	"\*[#-)!+-~]\+\*$" contains=helpStar
23071d4279SBram Moolenaarendif
2418144c84SBram Moolenaarsyn match helpBar		contained "|"
257fc904b6SBram Moolenaarsyn match helpStar		contained "\*"
26071d4279SBram Moolenaarsyn match helpNormal		"|.*====*|"
27071d4279SBram Moolenaarsyn match helpNormal		":|vim:|"	" for :help modeline
28071d4279SBram Moolenaarsyn match helpVim		"Vim version [0-9.a-z]\+"
29071d4279SBram Moolenaarsyn match helpVim		"VIM REFERENCE.*"
30071d4279SBram Moolenaarsyn match helpOption		"'[a-z]\{2,\}'"
31071d4279SBram Moolenaarsyn match helpOption		"'t_..'"
32071d4279SBram Moolenaarsyn match helpHeader		"\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
33071d4279SBram Moolenaarsyn match helpIgnore		"." contained
34071d4279SBram Moolenaarsyn keyword helpNote		note Note NOTE note: Note: NOTE: Notes Notes:
35071d4279SBram Moolenaarsyn match helpSpecial		"\<N\>"
36071d4279SBram Moolenaarsyn match helpSpecial		"\<N\.$"me=e-1
37071d4279SBram Moolenaarsyn match helpSpecial		"\<N\.\s"me=e-2
38071d4279SBram Moolenaarsyn match helpSpecial		"(N\>"ms=s+1
39071d4279SBram Moolenaarsyn match helpSpecial		"\[N]"
40071d4279SBram Moolenaar" avoid highlighting N  N in help.txt
41071d4279SBram Moolenaarsyn match helpSpecial		"N  N"he=s+1
42071d4279SBram Moolenaarsyn match helpSpecial		"Nth"me=e-2
43071d4279SBram Moolenaarsyn match helpSpecial		"N-1"me=e-2
44071d4279SBram Moolenaarsyn match helpSpecial		"{[-a-zA-Z0-9'":%#=[\]<>.,]\+}"
45071d4279SBram Moolenaarsyn match helpSpecial		"{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}"
46071d4279SBram Moolenaarsyn match helpSpecial		"\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1
47071d4279SBram Moolenaarsyn match helpSpecial		"<[-a-zA-Z0-9_]\+>"
48071d4279SBram Moolenaarsyn match helpSpecial		"<[SCM]-.>"
49071d4279SBram Moolenaarsyn match helpNormal		"<---*>"
50071d4279SBram Moolenaarsyn match helpSpecial		"\[range]"
51071d4279SBram Moolenaarsyn match helpSpecial		"\[line]"
52071d4279SBram Moolenaarsyn match helpSpecial		"\[count]"
53071d4279SBram Moolenaarsyn match helpSpecial		"\[offset]"
54071d4279SBram Moolenaarsyn match helpSpecial		"\[cmd]"
55071d4279SBram Moolenaarsyn match helpSpecial		"\[num]"
56071d4279SBram Moolenaarsyn match helpSpecial		"\[+num]"
57071d4279SBram Moolenaarsyn match helpSpecial		"\[-num]"
58071d4279SBram Moolenaarsyn match helpSpecial		"\[+cmd]"
59071d4279SBram Moolenaarsyn match helpSpecial		"\[++opt]"
60071d4279SBram Moolenaarsyn match helpSpecial		"\[arg]"
61071d4279SBram Moolenaarsyn match helpSpecial		"\[arguments]"
62071d4279SBram Moolenaarsyn match helpSpecial		"\[ident]"
63071d4279SBram Moolenaarsyn match helpSpecial		"\[addr]"
64071d4279SBram Moolenaarsyn match helpSpecial		"\[group]"
65071d4279SBram Moolenaarsyn match helpSpecial		"CTRL-."
66071d4279SBram Moolenaarsyn match helpSpecial		"CTRL-Break"
67071d4279SBram Moolenaarsyn match helpSpecial		"CTRL-PageUp"
68071d4279SBram Moolenaarsyn match helpSpecial		"CTRL-PageDown"
69071d4279SBram Moolenaarsyn match helpSpecial		"CTRL-Insert"
70071d4279SBram Moolenaarsyn match helpSpecial		"CTRL-Del"
71071d4279SBram Moolenaarsyn match helpSpecial		"CTRL-{char}"
72071d4279SBram Moolenaarsyn region helpNotVi		start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump
73071d4279SBram Moolenaarsyn match helpLeadBlank		"^\s\+" contained
74071d4279SBram Moolenaar
75071d4279SBram Moolenaar" Highlight group items in their own color.
76071d4279SBram Moolenaarsyn match helpComment		"\t[* ]Comment\t\+[a-z].*"
77071d4279SBram Moolenaarsyn match helpConstant		"\t[* ]Constant\t\+[a-z].*"
78071d4279SBram Moolenaarsyn match helpString		"\t[* ]String\t\+[a-z].*"
79071d4279SBram Moolenaarsyn match helpCharacter		"\t[* ]Character\t\+[a-z].*"
80071d4279SBram Moolenaarsyn match helpNumber		"\t[* ]Number\t\+[a-z].*"
81071d4279SBram Moolenaarsyn match helpBoolean		"\t[* ]Boolean\t\+[a-z].*"
82071d4279SBram Moolenaarsyn match helpFloat		"\t[* ]Float\t\+[a-z].*"
83071d4279SBram Moolenaarsyn match helpIdentifier	"\t[* ]Identifier\t\+[a-z].*"
84071d4279SBram Moolenaarsyn match helpFunction		"\t[* ]Function\t\+[a-z].*"
85071d4279SBram Moolenaarsyn match helpStatement		"\t[* ]Statement\t\+[a-z].*"
86071d4279SBram Moolenaarsyn match helpConditional	"\t[* ]Conditional\t\+[a-z].*"
87071d4279SBram Moolenaarsyn match helpRepeat		"\t[* ]Repeat\t\+[a-z].*"
88071d4279SBram Moolenaarsyn match helpLabel		"\t[* ]Label\t\+[a-z].*"
89071d4279SBram Moolenaarsyn match helpOperator		"\t[* ]Operator\t\+["a-z].*"
90071d4279SBram Moolenaarsyn match helpKeyword		"\t[* ]Keyword\t\+[a-z].*"
91071d4279SBram Moolenaarsyn match helpException		"\t[* ]Exception\t\+[a-z].*"
92071d4279SBram Moolenaarsyn match helpPreProc		"\t[* ]PreProc\t\+[a-z].*"
93071d4279SBram Moolenaarsyn match helpInclude		"\t[* ]Include\t\+[a-z].*"
94071d4279SBram Moolenaarsyn match helpDefine		"\t[* ]Define\t\+[a-z].*"
95071d4279SBram Moolenaarsyn match helpMacro		"\t[* ]Macro\t\+[a-z].*"
96071d4279SBram Moolenaarsyn match helpPreCondit		"\t[* ]PreCondit\t\+[a-z].*"
97071d4279SBram Moolenaarsyn match helpType		"\t[* ]Type\t\+[a-z].*"
98071d4279SBram Moolenaarsyn match helpStorageClass	"\t[* ]StorageClass\t\+[a-z].*"
99071d4279SBram Moolenaarsyn match helpStructure		"\t[* ]Structure\t\+[a-z].*"
100071d4279SBram Moolenaarsyn match helpTypedef		"\t[* ]Typedef\t\+[Aa-z].*"
101071d4279SBram Moolenaarsyn match helpSpecial		"\t[* ]Special\t\+[a-z].*"
102071d4279SBram Moolenaarsyn match helpSpecialChar	"\t[* ]SpecialChar\t\+[a-z].*"
103071d4279SBram Moolenaarsyn match helpTag		"\t[* ]Tag\t\+[a-z].*"
104071d4279SBram Moolenaarsyn match helpDelimiter		"\t[* ]Delimiter\t\+[a-z].*"
105071d4279SBram Moolenaarsyn match helpSpecialComment	"\t[* ]SpecialComment\t\+[a-z].*"
106071d4279SBram Moolenaarsyn match helpDebug		"\t[* ]Debug\t\+[a-z].*"
107071d4279SBram Moolenaarsyn match helpUnderlined	"\t[* ]Underlined\t\+[a-z].*"
108071d4279SBram Moolenaarsyn match helpError		"\t[* ]Error\t\+[a-z].*"
109071d4279SBram Moolenaarsyn match helpTodo		"\t[* ]Todo\t\+[a-z].*"
110071d4279SBram Moolenaar
1113991dab8SBram Moolenaarsyn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' 	<>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' 	<>"]+)[a-zA-Z0-9/]`
112071d4279SBram Moolenaar
113071d4279SBram Moolenaar" Additionally load a language-specific syntax file "help_ab.vim".
11413fcaaf1SBram Moolenaarlet s:i = match(expand("%"), '\.\a\ax$')
11513fcaaf1SBram Moolenaarif s:i > 0
11613fcaaf1SBram Moolenaar  exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
117071d4279SBram Moolenaarendif
118071d4279SBram Moolenaar
119071d4279SBram Moolenaarsyn sync minlines=40
120071d4279SBram Moolenaar
121071d4279SBram Moolenaar
122071d4279SBram Moolenaar" Define the default highlighting.
123d857f0e0SBram Moolenaar" Only used when an item doesn't have highlighting yet
124d857f0e0SBram Moolenaarhi def link helpExampleStart	helpIgnore
125d857f0e0SBram Moolenaarhi def link helpIgnore		Ignore
126d857f0e0SBram Moolenaarhi def link helpHyperTextJump	Subtitle
12718144c84SBram Moolenaarhi def link helpBar		Ignore
1287fc904b6SBram Moolenaarhi def link helpStar		Ignore
129d857f0e0SBram Moolenaarhi def link helpHyperTextEntry	String
130d857f0e0SBram Moolenaarhi def link helpHeadline	Statement
131d857f0e0SBram Moolenaarhi def link helpHeader		PreProc
132d857f0e0SBram Moolenaarhi def link helpSectionDelim	PreProc
133d857f0e0SBram Moolenaarhi def link helpVim		Identifier
134d857f0e0SBram Moolenaarhi def link helpExample		Comment
135d857f0e0SBram Moolenaarhi def link helpOption		Type
136d857f0e0SBram Moolenaarhi def link helpNotVi		Special
137d857f0e0SBram Moolenaarhi def link helpSpecial		Special
138d857f0e0SBram Moolenaarhi def link helpNote		Todo
139d857f0e0SBram Moolenaarhi def link Subtitle		Identifier
140071d4279SBram Moolenaar
141d857f0e0SBram Moolenaarhi def link helpComment		Comment
142d857f0e0SBram Moolenaarhi def link helpConstant	Constant
143d857f0e0SBram Moolenaarhi def link helpString		String
144d857f0e0SBram Moolenaarhi def link helpCharacter	Character
145d857f0e0SBram Moolenaarhi def link helpNumber		Number
146d857f0e0SBram Moolenaarhi def link helpBoolean		Boolean
147d857f0e0SBram Moolenaarhi def link helpFloat		Float
148d857f0e0SBram Moolenaarhi def link helpIdentifier	Identifier
149d857f0e0SBram Moolenaarhi def link helpFunction	Function
150d857f0e0SBram Moolenaarhi def link helpStatement	Statement
151d857f0e0SBram Moolenaarhi def link helpConditional	Conditional
152d857f0e0SBram Moolenaarhi def link helpRepeat		Repeat
153d857f0e0SBram Moolenaarhi def link helpLabel		Label
154d857f0e0SBram Moolenaarhi def link helpOperator	Operator
155d857f0e0SBram Moolenaarhi def link helpKeyword		Keyword
156d857f0e0SBram Moolenaarhi def link helpException	Exception
157d857f0e0SBram Moolenaarhi def link helpPreProc		PreProc
158d857f0e0SBram Moolenaarhi def link helpInclude		Include
159d857f0e0SBram Moolenaarhi def link helpDefine		Define
160d857f0e0SBram Moolenaarhi def link helpMacro		Macro
161d857f0e0SBram Moolenaarhi def link helpPreCondit	PreCondit
162d857f0e0SBram Moolenaarhi def link helpType		Type
163d857f0e0SBram Moolenaarhi def link helpStorageClass	StorageClass
164d857f0e0SBram Moolenaarhi def link helpStructure	Structure
165d857f0e0SBram Moolenaarhi def link helpTypedef		Typedef
166d857f0e0SBram Moolenaarhi def link helpSpecialChar	SpecialChar
167d857f0e0SBram Moolenaarhi def link helpTag		Tag
168d857f0e0SBram Moolenaarhi def link helpDelimiter	Delimiter
169d857f0e0SBram Moolenaarhi def link helpSpecialComment	SpecialComment
170d857f0e0SBram Moolenaarhi def link helpDebug		Debug
171d857f0e0SBram Moolenaarhi def link helpUnderlined	Underlined
172d857f0e0SBram Moolenaarhi def link helpError		Error
173d857f0e0SBram Moolenaarhi def link helpTodo		Todo
174e344beadSBram Moolenaarhi def link helpURL		String
175071d4279SBram Moolenaar
176071d4279SBram Moolenaarlet b:current_syntax = "help"
177071d4279SBram Moolenaar
178071d4279SBram Moolenaar" vim: ts=8 sw=2
179