blob: 82c346826dafa47502e322f3add89733b284c715 [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 Moolenaar166af9b2010-11-16 20:34:40 +01004" Last Change: 2010 Nov 03
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 Moolenaar349b2fb2010-07-16 20:35:36 +020024syn match helpBar contained "|" conceal
25syn match helpStar contained "\*" conceal
Bram Moolenaar071d4272004-06-13 20:20:40 +000026syn match helpNormal "|.*====*|"
27syn match helpNormal ":|vim:|" " for :help modeline
28syn match helpVim "Vim version [0-9.a-z]\+"
29syn match helpVim "VIM REFERENCE.*"
30syn match helpOption "'[a-z]\{2,\}'"
31syn match helpOption "'t_..'"
32syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
Bram Moolenaar166af9b2010-11-16 20:34:40 +010033syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore
Bram Moolenaar349b2fb2010-07-16 20:35:36 +020034syn match helpIgnore "." contained conceal
Bram Moolenaar071d4272004-06-13 20:20:40 +000035syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
36syn match helpSpecial "\<N\>"
37syn match helpSpecial "\<N\.$"me=e-1
38syn match helpSpecial "\<N\.\s"me=e-2
39syn match helpSpecial "(N\>"ms=s+1
40syn match helpSpecial "\[N]"
41" avoid highlighting N N in help.txt
42syn match helpSpecial "N N"he=s+1
43syn match helpSpecial "Nth"me=e-2
44syn match helpSpecial "N-1"me=e-2
45syn match helpSpecial "{[-a-zA-Z0-9'":%#=[\]<>.,]\+}"
46syn match helpSpecial "{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}"
47syn match helpSpecial "\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1
48syn match helpSpecial "<[-a-zA-Z0-9_]\+>"
49syn match helpSpecial "<[SCM]-.>"
50syn match helpNormal "<---*>"
51syn match helpSpecial "\[range]"
52syn match helpSpecial "\[line]"
53syn match helpSpecial "\[count]"
54syn match helpSpecial "\[offset]"
55syn match helpSpecial "\[cmd]"
56syn match helpSpecial "\[num]"
57syn match helpSpecial "\[+num]"
58syn match helpSpecial "\[-num]"
59syn match helpSpecial "\[+cmd]"
60syn match helpSpecial "\[++opt]"
61syn match helpSpecial "\[arg]"
62syn match helpSpecial "\[arguments]"
63syn match helpSpecial "\[ident]"
64syn match helpSpecial "\[addr]"
65syn match helpSpecial "\[group]"
66syn match helpSpecial "CTRL-."
67syn match helpSpecial "CTRL-Break"
68syn match helpSpecial "CTRL-PageUp"
69syn match helpSpecial "CTRL-PageDown"
70syn match helpSpecial "CTRL-Insert"
71syn match helpSpecial "CTRL-Del"
72syn match helpSpecial "CTRL-{char}"
73syn region helpNotVi start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump
74syn match helpLeadBlank "^\s\+" contained
75
76" Highlight group items in their own color.
77syn match helpComment "\t[* ]Comment\t\+[a-z].*"
78syn match helpConstant "\t[* ]Constant\t\+[a-z].*"
79syn match helpString "\t[* ]String\t\+[a-z].*"
80syn match helpCharacter "\t[* ]Character\t\+[a-z].*"
81syn match helpNumber "\t[* ]Number\t\+[a-z].*"
82syn match helpBoolean "\t[* ]Boolean\t\+[a-z].*"
83syn match helpFloat "\t[* ]Float\t\+[a-z].*"
84syn match helpIdentifier "\t[* ]Identifier\t\+[a-z].*"
85syn match helpFunction "\t[* ]Function\t\+[a-z].*"
86syn match helpStatement "\t[* ]Statement\t\+[a-z].*"
87syn match helpConditional "\t[* ]Conditional\t\+[a-z].*"
88syn match helpRepeat "\t[* ]Repeat\t\+[a-z].*"
89syn match helpLabel "\t[* ]Label\t\+[a-z].*"
90syn match helpOperator "\t[* ]Operator\t\+["a-z].*"
91syn match helpKeyword "\t[* ]Keyword\t\+[a-z].*"
92syn match helpException "\t[* ]Exception\t\+[a-z].*"
93syn match helpPreProc "\t[* ]PreProc\t\+[a-z].*"
94syn match helpInclude "\t[* ]Include\t\+[a-z].*"
95syn match helpDefine "\t[* ]Define\t\+[a-z].*"
96syn match helpMacro "\t[* ]Macro\t\+[a-z].*"
97syn match helpPreCondit "\t[* ]PreCondit\t\+[a-z].*"
98syn match helpType "\t[* ]Type\t\+[a-z].*"
99syn match helpStorageClass "\t[* ]StorageClass\t\+[a-z].*"
100syn match helpStructure "\t[* ]Structure\t\+[a-z].*"
101syn match helpTypedef "\t[* ]Typedef\t\+[Aa-z].*"
102syn match helpSpecial "\t[* ]Special\t\+[a-z].*"
103syn match helpSpecialChar "\t[* ]SpecialChar\t\+[a-z].*"
104syn match helpTag "\t[* ]Tag\t\+[a-z].*"
105syn match helpDelimiter "\t[* ]Delimiter\t\+[a-z].*"
106syn match helpSpecialComment "\t[* ]SpecialComment\t\+[a-z].*"
107syn match helpDebug "\t[* ]Debug\t\+[a-z].*"
108syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
109syn match helpError "\t[* ]Error\t\+[a-z].*"
110syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
111
Bram Moolenaar3991dab2006-03-27 17:01:56 +0000112syn 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 +0000113
114" Additionally load a language-specific syntax file "help_ab.vim".
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000115let s:i = match(expand("%"), '\.\a\ax$')
116if s:i > 0
117 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118endif
119
Bram Moolenaard04b7502010-07-08 22:27:55 +0200120" Italian
Bram Moolenaar7abcaab2010-07-12 23:05:41 +0200121if v:lang =~ '\<IT\>' || v:lang =~ '_IT\>' || v:lang =~? "italian"
122 syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
Bram Moolenaard04b7502010-07-08 22:27:55 +0200123 syn match helpSpecial "Nma"me=e-2
124 syn match helpSpecial "Nme"me=e-2
125 syn match helpSpecial "Nmi"me=e-2
126 syn match helpSpecial "Nmo"me=e-2
127 syn match helpSpecial "\[interv.]"
128 syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
129endif
130
Bram Moolenaar071d4272004-06-13 20:20:40 +0000131syn sync minlines=40
132
133
134" Define the default highlighting.
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000135" Only used when an item doesn't have highlighting yet
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000136hi def link helpIgnore Ignore
137hi def link helpHyperTextJump Subtitle
Bram Moolenaar18144c82006-04-12 21:52:12 +0000138hi def link helpBar Ignore
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000139hi def link helpStar Ignore
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000140hi def link helpHyperTextEntry String
141hi def link helpHeadline Statement
142hi def link helpHeader PreProc
143hi def link helpSectionDelim PreProc
144hi def link helpVim Identifier
145hi def link helpExample Comment
146hi def link helpOption Type
147hi def link helpNotVi Special
148hi def link helpSpecial Special
149hi def link helpNote Todo
150hi def link Subtitle Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000152hi def link helpComment Comment
153hi def link helpConstant Constant
154hi def link helpString String
155hi def link helpCharacter Character
156hi def link helpNumber Number
157hi def link helpBoolean Boolean
158hi def link helpFloat Float
159hi def link helpIdentifier Identifier
160hi def link helpFunction Function
161hi def link helpStatement Statement
162hi def link helpConditional Conditional
163hi def link helpRepeat Repeat
164hi def link helpLabel Label
165hi def link helpOperator Operator
166hi def link helpKeyword Keyword
167hi def link helpException Exception
168hi def link helpPreProc PreProc
169hi def link helpInclude Include
170hi def link helpDefine Define
171hi def link helpMacro Macro
172hi def link helpPreCondit PreCondit
173hi def link helpType Type
174hi def link helpStorageClass StorageClass
175hi def link helpStructure Structure
176hi def link helpTypedef Typedef
177hi def link helpSpecialChar SpecialChar
178hi def link helpTag Tag
179hi def link helpDelimiter Delimiter
180hi def link helpSpecialComment SpecialComment
181hi def link helpDebug Debug
182hi def link helpUnderlined Underlined
183hi def link helpError Error
184hi def link helpTodo Todo
Bram Moolenaare344bea2005-09-01 20:46:49 +0000185hi def link helpURL String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000186
187let b:current_syntax = "help"
188
189" vim: ts=8 sw=2