blob: 70c4e65674c3a8a4f7a3968b1bb16bbc1324e8f8 [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 Moolenaar3ec574f2017-06-13 18:12:01 +02004" Last Change: 2017 Jun 13
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 Moolenaar6ee8d892012-01-10 14:55:01 +010011let s:cpo_save = &cpo
12set cpo&vim
13
Bram Moolenaar5c736222010-01-06 20:54:52 +010014syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()]*[ \t]\+\*"me=e-1
Bram Moolenaar6c35bea2012-07-25 17:49:10 +020015syn match helpSectionDelim "^===.*===$"
16syn match helpSectionDelim "^---.*--$"
Bram Moolenaardd007ed2013-07-09 15:44:17 +020017if 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000022if has("ebcdic")
Bram Moolenaar18144c82006-04-12 21:52:12 +000023 syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000024 syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
25 syn match helpHyperTextEntry "\*[^"*|]\+\*$" contains=helpStar
Bram Moolenaar071d4272004-06-13 20:20:40 +000026else
Bram Moolenaar18144c82006-04-12 21:52:12 +000027 syn match helpHyperTextJump "\\\@<!|[#-)!+-~]\+|" contains=helpBar
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000028 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*\s"he=e-1 contains=helpStar
29 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*$" contains=helpStar
Bram Moolenaar071d4272004-06-13 20:20:40 +000030endif
Bram Moolenaar97293012011-07-18 19:40:27 +020031if has("conceal")
Bram Moolenaarfa13eef2013-02-06 17:34:04 +010032 syn match helpBar contained "|" conceal
33 syn match helpBacktick contained "`" conceal
Bram Moolenaar97293012011-07-18 19:40:27 +020034 syn match helpStar contained "\*" conceal
35else
Bram Moolenaarfa13eef2013-02-06 17:34:04 +010036 syn match helpBar contained "|"
37 syn match helpBacktick contained "`"
Bram Moolenaar97293012011-07-18 19:40:27 +020038 syn match helpStar contained "\*"
39endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000040syn match helpNormal "|.*====*|"
Bram Moolenaarf1568ec2011-12-14 21:17:39 +010041syn match helpNormal "|||"
Bram Moolenaar071d4272004-06-13 20:20:40 +000042syn match helpNormal ":|vim:|" " for :help modeline
Bram Moolenaar251835e2014-02-24 02:51:51 +010043syn match helpVim "\<Vim version [0-9][0-9.a-z]*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000044syn match helpVim "VIM REFERENCE.*"
45syn match helpOption "'[a-z]\{2,\}'"
46syn match helpOption "'t_..'"
Bram Moolenaar7cba6c02013-09-05 22:13:31 +020047syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick
Bram Moolenaar939a1ab2016-04-10 01:31:25 +020048syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick
Bram Moolenaar071d4272004-06-13 20:20:40 +000049syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
Bram Moolenaar166af9b2010-11-16 20:34:40 +010050syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore
Bram Moolenaar97293012011-07-18 19:40:27 +020051if has("conceal")
52 syn match helpIgnore "." contained conceal
53else
54 syn match helpIgnore "." contained
55endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000056syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020057syn keyword helpWarning WARNING WARNING: Warning:
58syn keyword helpDeprecated DEPRECATED DEPRECATED: Deprecated:
Bram Moolenaar071d4272004-06-13 20:20:40 +000059syn match helpSpecial "\<N\>"
60syn match helpSpecial "\<N\.$"me=e-1
61syn match helpSpecial "\<N\.\s"me=e-2
62syn match helpSpecial "(N\>"ms=s+1
63syn match helpSpecial "\[N]"
64" avoid highlighting N N in help.txt
65syn match helpSpecial "N N"he=s+1
66syn match helpSpecial "Nth"me=e-2
67syn match helpSpecial "N-1"me=e-2
Bram Moolenaar071d4272004-06-13 20:20:40 +000068syn match helpSpecial "{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}"
69syn match helpSpecial "\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1
70syn match helpSpecial "<[-a-zA-Z0-9_]\+>"
71syn match helpSpecial "<[SCM]-.>"
72syn match helpNormal "<---*>"
73syn match helpSpecial "\[range]"
74syn match helpSpecial "\[line]"
75syn match helpSpecial "\[count]"
76syn match helpSpecial "\[offset]"
77syn match helpSpecial "\[cmd]"
78syn match helpSpecial "\[num]"
79syn match helpSpecial "\[+num]"
80syn match helpSpecial "\[-num]"
81syn match helpSpecial "\[+cmd]"
82syn match helpSpecial "\[++opt]"
83syn match helpSpecial "\[arg]"
84syn match helpSpecial "\[arguments]"
85syn match helpSpecial "\[ident]"
86syn match helpSpecial "\[addr]"
87syn match helpSpecial "\[group]"
88syn match helpSpecial "CTRL-."
89syn match helpSpecial "CTRL-Break"
90syn match helpSpecial "CTRL-PageUp"
91syn match helpSpecial "CTRL-PageDown"
92syn match helpSpecial "CTRL-Insert"
93syn match helpSpecial "CTRL-Del"
94syn match helpSpecial "CTRL-{char}"
95syn region helpNotVi start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump
96syn match helpLeadBlank "^\s\+" contained
97
98" Highlight group items in their own color.
99syn match helpComment "\t[* ]Comment\t\+[a-z].*"
100syn match helpConstant "\t[* ]Constant\t\+[a-z].*"
101syn match helpString "\t[* ]String\t\+[a-z].*"
102syn match helpCharacter "\t[* ]Character\t\+[a-z].*"
103syn match helpNumber "\t[* ]Number\t\+[a-z].*"
104syn match helpBoolean "\t[* ]Boolean\t\+[a-z].*"
105syn match helpFloat "\t[* ]Float\t\+[a-z].*"
106syn match helpIdentifier "\t[* ]Identifier\t\+[a-z].*"
107syn match helpFunction "\t[* ]Function\t\+[a-z].*"
108syn match helpStatement "\t[* ]Statement\t\+[a-z].*"
109syn match helpConditional "\t[* ]Conditional\t\+[a-z].*"
110syn match helpRepeat "\t[* ]Repeat\t\+[a-z].*"
111syn match helpLabel "\t[* ]Label\t\+[a-z].*"
112syn match helpOperator "\t[* ]Operator\t\+["a-z].*"
113syn match helpKeyword "\t[* ]Keyword\t\+[a-z].*"
114syn match helpException "\t[* ]Exception\t\+[a-z].*"
115syn match helpPreProc "\t[* ]PreProc\t\+[a-z].*"
116syn match helpInclude "\t[* ]Include\t\+[a-z].*"
117syn match helpDefine "\t[* ]Define\t\+[a-z].*"
118syn match helpMacro "\t[* ]Macro\t\+[a-z].*"
119syn match helpPreCondit "\t[* ]PreCondit\t\+[a-z].*"
120syn match helpType "\t[* ]Type\t\+[a-z].*"
121syn match helpStorageClass "\t[* ]StorageClass\t\+[a-z].*"
122syn match helpStructure "\t[* ]Structure\t\+[a-z].*"
123syn match helpTypedef "\t[* ]Typedef\t\+[Aa-z].*"
124syn match helpSpecial "\t[* ]Special\t\+[a-z].*"
125syn match helpSpecialChar "\t[* ]SpecialChar\t\+[a-z].*"
126syn match helpTag "\t[* ]Tag\t\+[a-z].*"
127syn match helpDelimiter "\t[* ]Delimiter\t\+[a-z].*"
128syn match helpSpecialComment "\t[* ]SpecialComment\t\+[a-z].*"
129syn match helpDebug "\t[* ]Debug\t\+[a-z].*"
130syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
131syn match helpError "\t[* ]Error\t\+[a-z].*"
132syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
133
Bram Moolenaar3991dab2006-03-27 17:01:56 +0000134syn 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 +0000135
136" Additionally load a language-specific syntax file "help_ab.vim".
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000137let s:i = match(expand("%"), '\.\a\ax$')
138if s:i > 0
139 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000140endif
141
Bram Moolenaard04b7502010-07-08 22:27:55 +0200142" Italian
Bram Moolenaar7abcaab2010-07-12 23:05:41 +0200143if v:lang =~ '\<IT\>' || v:lang =~ '_IT\>' || v:lang =~? "italian"
144 syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
Bram Moolenaard04b7502010-07-08 22:27:55 +0200145 syn match helpSpecial "Nma"me=e-2
146 syn match helpSpecial "Nme"me=e-2
147 syn match helpSpecial "Nmi"me=e-2
148 syn match helpSpecial "Nmo"me=e-2
149 syn match helpSpecial "\[interv.]"
150 syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
151endif
152
Bram Moolenaar071d4272004-06-13 20:20:40 +0000153syn sync minlines=40
154
155
156" Define the default highlighting.
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000157" Only used when an item doesn't have highlighting yet
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000158hi def link helpIgnore Ignore
Bram Moolenaar36782082013-11-28 13:53:34 +0100159hi def link helpHyperTextJump Identifier
Bram Moolenaar18144c82006-04-12 21:52:12 +0000160hi def link helpBar Ignore
Bram Moolenaarfa13eef2013-02-06 17:34:04 +0100161hi def link helpBacktick Ignore
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000162hi def link helpStar Ignore
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000163hi def link helpHyperTextEntry String
164hi def link helpHeadline Statement
165hi def link helpHeader PreProc
166hi def link helpSectionDelim PreProc
167hi def link helpVim Identifier
Bram Moolenaard38b0552012-04-25 19:07:41 +0200168hi def link helpCommand Comment
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000169hi def link helpExample Comment
170hi def link helpOption Type
171hi def link helpNotVi Special
172hi def link helpSpecial Special
173hi def link helpNote Todo
Bram Moolenaar64d8e252016-09-06 22:12:34 +0200174hi def link helpWarning Todo
Bram Moolenaar3ec574f2017-06-13 18:12:01 +0200175hi def link helpDeprecated Todo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000176
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000177hi def link helpComment Comment
178hi def link helpConstant Constant
179hi def link helpString String
180hi def link helpCharacter Character
181hi def link helpNumber Number
182hi def link helpBoolean Boolean
183hi def link helpFloat Float
184hi def link helpIdentifier Identifier
185hi def link helpFunction Function
186hi def link helpStatement Statement
187hi def link helpConditional Conditional
188hi def link helpRepeat Repeat
189hi def link helpLabel Label
190hi def link helpOperator Operator
191hi def link helpKeyword Keyword
192hi def link helpException Exception
193hi def link helpPreProc PreProc
194hi def link helpInclude Include
195hi def link helpDefine Define
196hi def link helpMacro Macro
197hi def link helpPreCondit PreCondit
198hi def link helpType Type
199hi def link helpStorageClass StorageClass
200hi def link helpStructure Structure
201hi def link helpTypedef Typedef
202hi def link helpSpecialChar SpecialChar
203hi def link helpTag Tag
204hi def link helpDelimiter Delimiter
205hi def link helpSpecialComment SpecialComment
206hi def link helpDebug Debug
207hi def link helpUnderlined Underlined
208hi def link helpError Error
209hi def link helpTodo Todo
Bram Moolenaare344bea2005-09-01 20:46:49 +0000210hi def link helpURL String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000211
212let b:current_syntax = "help"
213
Bram Moolenaar6ee8d892012-01-10 14:55:01 +0100214let &cpo = s:cpo_save
215unlet s:cpo_save
Bram Moolenaar071d4272004-06-13 20:20:40 +0000216" vim: ts=8 sw=2