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