blob: 8d85d02c8a1c81d3c19762b723bf558d66ec3cbe [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 Moolenaar8e52a592012-05-18 21:49:28 +02004" Last Change: 2012 May 18
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 Moolenaar071d4272004-06-13 20:20:40 +000015syn match helpSectionDelim "^=\{3,}.*===$"
16syn match helpSectionDelim "^-\{3,}.*--$"
Bram Moolenaard28478b2010-07-18 23:29:58 +020017syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
Bram Moolenaar071d4272004-06-13 20:20:40 +000018if has("ebcdic")
Bram Moolenaar18144c82006-04-12 21:52:12 +000019 syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000020 syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
21 syn match helpHyperTextEntry "\*[^"*|]\+\*$" contains=helpStar
Bram Moolenaar071d4272004-06-13 20:20:40 +000022else
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 +000026endif
Bram Moolenaar97293012011-07-18 19:40:27 +020027if has("conceal")
Bram Moolenaar8e52a592012-05-18 21:49:28 +020028 syn match helpBar contained "[|`]" conceal
Bram Moolenaar97293012011-07-18 19:40:27 +020029 syn match helpStar contained "\*" conceal
30else
Bram Moolenaar8e52a592012-05-18 21:49:28 +020031 syn match helpBar contained "[|`]"
Bram Moolenaar97293012011-07-18 19:40:27 +020032 syn match helpStar contained "\*"
33endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000034syn match helpNormal "|.*====*|"
Bram Moolenaarf1568ec2011-12-14 21:17:39 +010035syn match helpNormal "|||"
Bram Moolenaar071d4272004-06-13 20:20:40 +000036syn match helpNormal ":|vim:|" " for :help modeline
37syn match helpVim "Vim version [0-9.a-z]\+"
38syn match helpVim "VIM REFERENCE.*"
39syn match helpOption "'[a-z]\{2,\}'"
40syn match helpOption "'t_..'"
Bram Moolenaar8e52a592012-05-18 21:49:28 +020041syn match helpCommand "`[^` ]*`"hs=s+1,he=e-1 contains=helpBar
Bram Moolenaar071d4272004-06-13 20:20:40 +000042syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
Bram Moolenaar166af9b2010-11-16 20:34:40 +010043syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore
Bram Moolenaar97293012011-07-18 19:40:27 +020044if has("conceal")
45 syn match helpIgnore "." contained conceal
46else
47 syn match helpIgnore "." contained
48endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000049syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
50syn match helpSpecial "\<N\>"
51syn match helpSpecial "\<N\.$"me=e-1
52syn match helpSpecial "\<N\.\s"me=e-2
53syn match helpSpecial "(N\>"ms=s+1
54syn match helpSpecial "\[N]"
55" avoid highlighting N N in help.txt
56syn match helpSpecial "N N"he=s+1
57syn match helpSpecial "Nth"me=e-2
58syn match helpSpecial "N-1"me=e-2
59syn match helpSpecial "{[-a-zA-Z0-9'":%#=[\]<>.,]\+}"
60syn match helpSpecial "{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}"
61syn match helpSpecial "\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1
62syn match helpSpecial "<[-a-zA-Z0-9_]\+>"
63syn match helpSpecial "<[SCM]-.>"
64syn match helpNormal "<---*>"
65syn match helpSpecial "\[range]"
66syn match helpSpecial "\[line]"
67syn match helpSpecial "\[count]"
68syn match helpSpecial "\[offset]"
69syn match helpSpecial "\[cmd]"
70syn match helpSpecial "\[num]"
71syn match helpSpecial "\[+num]"
72syn match helpSpecial "\[-num]"
73syn match helpSpecial "\[+cmd]"
74syn match helpSpecial "\[++opt]"
75syn match helpSpecial "\[arg]"
76syn match helpSpecial "\[arguments]"
77syn match helpSpecial "\[ident]"
78syn match helpSpecial "\[addr]"
79syn match helpSpecial "\[group]"
80syn match helpSpecial "CTRL-."
81syn match helpSpecial "CTRL-Break"
82syn match helpSpecial "CTRL-PageUp"
83syn match helpSpecial "CTRL-PageDown"
84syn match helpSpecial "CTRL-Insert"
85syn match helpSpecial "CTRL-Del"
86syn match helpSpecial "CTRL-{char}"
87syn region helpNotVi start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump
88syn match helpLeadBlank "^\s\+" contained
89
90" Highlight group items in their own color.
91syn match helpComment "\t[* ]Comment\t\+[a-z].*"
92syn match helpConstant "\t[* ]Constant\t\+[a-z].*"
93syn match helpString "\t[* ]String\t\+[a-z].*"
94syn match helpCharacter "\t[* ]Character\t\+[a-z].*"
95syn match helpNumber "\t[* ]Number\t\+[a-z].*"
96syn match helpBoolean "\t[* ]Boolean\t\+[a-z].*"
97syn match helpFloat "\t[* ]Float\t\+[a-z].*"
98syn match helpIdentifier "\t[* ]Identifier\t\+[a-z].*"
99syn match helpFunction "\t[* ]Function\t\+[a-z].*"
100syn match helpStatement "\t[* ]Statement\t\+[a-z].*"
101syn match helpConditional "\t[* ]Conditional\t\+[a-z].*"
102syn match helpRepeat "\t[* ]Repeat\t\+[a-z].*"
103syn match helpLabel "\t[* ]Label\t\+[a-z].*"
104syn match helpOperator "\t[* ]Operator\t\+["a-z].*"
105syn match helpKeyword "\t[* ]Keyword\t\+[a-z].*"
106syn match helpException "\t[* ]Exception\t\+[a-z].*"
107syn match helpPreProc "\t[* ]PreProc\t\+[a-z].*"
108syn match helpInclude "\t[* ]Include\t\+[a-z].*"
109syn match helpDefine "\t[* ]Define\t\+[a-z].*"
110syn match helpMacro "\t[* ]Macro\t\+[a-z].*"
111syn match helpPreCondit "\t[* ]PreCondit\t\+[a-z].*"
112syn match helpType "\t[* ]Type\t\+[a-z].*"
113syn match helpStorageClass "\t[* ]StorageClass\t\+[a-z].*"
114syn match helpStructure "\t[* ]Structure\t\+[a-z].*"
115syn match helpTypedef "\t[* ]Typedef\t\+[Aa-z].*"
116syn match helpSpecial "\t[* ]Special\t\+[a-z].*"
117syn match helpSpecialChar "\t[* ]SpecialChar\t\+[a-z].*"
118syn match helpTag "\t[* ]Tag\t\+[a-z].*"
119syn match helpDelimiter "\t[* ]Delimiter\t\+[a-z].*"
120syn match helpSpecialComment "\t[* ]SpecialComment\t\+[a-z].*"
121syn match helpDebug "\t[* ]Debug\t\+[a-z].*"
122syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
123syn match helpError "\t[* ]Error\t\+[a-z].*"
124syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
125
Bram Moolenaar3991dab2006-03-27 17:01:56 +0000126syn 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 +0000127
128" Additionally load a language-specific syntax file "help_ab.vim".
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000129let s:i = match(expand("%"), '\.\a\ax$')
130if s:i > 0
131 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000132endif
133
Bram Moolenaard04b7502010-07-08 22:27:55 +0200134" Italian
Bram Moolenaar7abcaab2010-07-12 23:05:41 +0200135if v:lang =~ '\<IT\>' || v:lang =~ '_IT\>' || v:lang =~? "italian"
136 syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
Bram Moolenaard04b7502010-07-08 22:27:55 +0200137 syn match helpSpecial "Nma"me=e-2
138 syn match helpSpecial "Nme"me=e-2
139 syn match helpSpecial "Nmi"me=e-2
140 syn match helpSpecial "Nmo"me=e-2
141 syn match helpSpecial "\[interv.]"
142 syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
143endif
144
Bram Moolenaar071d4272004-06-13 20:20:40 +0000145syn sync minlines=40
146
147
148" Define the default highlighting.
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000149" Only used when an item doesn't have highlighting yet
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000150hi def link helpIgnore Ignore
151hi def link helpHyperTextJump Subtitle
Bram Moolenaar18144c82006-04-12 21:52:12 +0000152hi def link helpBar Ignore
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000153hi def link helpStar Ignore
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000154hi def link helpHyperTextEntry String
155hi def link helpHeadline Statement
156hi def link helpHeader PreProc
157hi def link helpSectionDelim PreProc
158hi def link helpVim Identifier
Bram Moolenaard38b0552012-04-25 19:07:41 +0200159hi def link helpCommand Comment
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000160hi def link helpExample Comment
161hi def link helpOption Type
162hi def link helpNotVi Special
163hi def link helpSpecial Special
164hi def link helpNote Todo
165hi def link Subtitle Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +0000166
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000167hi def link helpComment Comment
168hi def link helpConstant Constant
169hi def link helpString String
170hi def link helpCharacter Character
171hi def link helpNumber Number
172hi def link helpBoolean Boolean
173hi def link helpFloat Float
174hi def link helpIdentifier Identifier
175hi def link helpFunction Function
176hi def link helpStatement Statement
177hi def link helpConditional Conditional
178hi def link helpRepeat Repeat
179hi def link helpLabel Label
180hi def link helpOperator Operator
181hi def link helpKeyword Keyword
182hi def link helpException Exception
183hi def link helpPreProc PreProc
184hi def link helpInclude Include
185hi def link helpDefine Define
186hi def link helpMacro Macro
187hi def link helpPreCondit PreCondit
188hi def link helpType Type
189hi def link helpStorageClass StorageClass
190hi def link helpStructure Structure
191hi def link helpTypedef Typedef
192hi def link helpSpecialChar SpecialChar
193hi def link helpTag Tag
194hi def link helpDelimiter Delimiter
195hi def link helpSpecialComment SpecialComment
196hi def link helpDebug Debug
197hi def link helpUnderlined Underlined
198hi def link helpError Error
199hi def link helpTodo Todo
Bram Moolenaare344bea2005-09-01 20:46:49 +0000200hi def link helpURL String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000201
202let b:current_syntax = "help"
203
Bram Moolenaar6ee8d892012-01-10 14:55:01 +0100204let &cpo = s:cpo_save
205unlet s:cpo_save
Bram Moolenaar071d4272004-06-13 20:20:40 +0000206" vim: ts=8 sw=2