blob: 5c2abe024a29c6f7766d1f5acb5215a2d25f11d6 [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 Moolenaar18144c82006-04-12 21:52:12 +00004" Last Change: 2006 Apr 12
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 Moolenaar7b89edc2006-04-06 20:21:51 +000011syn match helpHeadline "^[-A-Z .]\+[ \t]\+\*"me=e-1
Bram Moolenaar071d4272004-06-13 20:20:40 +000012syn match helpSectionDelim "^=\{3,}.*===$"
13syn match helpSectionDelim "^-\{3,}.*--$"
14syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
15if has("ebcdic")
Bram Moolenaar18144c82006-04-12 21:52:12 +000016 syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
Bram Moolenaar071d4272004-06-13 20:20:40 +000017 syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1
18 syn match helpHyperTextEntry "\*[^"*|]\+\*$"
19else
Bram Moolenaar18144c82006-04-12 21:52:12 +000020 syn match helpHyperTextJump "\\\@<!|[#-)!+-~]\+|" contains=helpBar
Bram Moolenaar071d4272004-06-13 20:20:40 +000021 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*\s"he=e-1
22 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*$"
23endif
Bram Moolenaar18144c82006-04-12 21:52:12 +000024syn match helpBar contained "|"
Bram Moolenaar071d4272004-06-13 20:20:40 +000025syn match helpNormal "|.*====*|"
26syn match helpNormal ":|vim:|" " for :help modeline
27syn match helpVim "Vim version [0-9.a-z]\+"
28syn match helpVim "VIM REFERENCE.*"
29syn match helpOption "'[a-z]\{2,\}'"
30syn match helpOption "'t_..'"
31syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
32syn match helpIgnore "." contained
33syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
34syn match helpSpecial "\<N\>"
35syn match helpSpecial "\<N\.$"me=e-1
36syn match helpSpecial "\<N\.\s"me=e-2
37syn match helpSpecial "(N\>"ms=s+1
38syn match helpSpecial "\[N]"
39" avoid highlighting N N in help.txt
40syn match helpSpecial "N N"he=s+1
41syn match helpSpecial "Nth"me=e-2
42syn match helpSpecial "N-1"me=e-2
43syn match helpSpecial "{[-a-zA-Z0-9'":%#=[\]<>.,]\+}"
44syn match helpSpecial "{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}"
45syn match helpSpecial "\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1
46syn match helpSpecial "<[-a-zA-Z0-9_]\+>"
47syn match helpSpecial "<[SCM]-.>"
48syn match helpNormal "<---*>"
49syn match helpSpecial "\[range]"
50syn match helpSpecial "\[line]"
51syn match helpSpecial "\[count]"
52syn match helpSpecial "\[offset]"
53syn match helpSpecial "\[cmd]"
54syn match helpSpecial "\[num]"
55syn match helpSpecial "\[+num]"
56syn match helpSpecial "\[-num]"
57syn match helpSpecial "\[+cmd]"
58syn match helpSpecial "\[++opt]"
59syn match helpSpecial "\[arg]"
60syn match helpSpecial "\[arguments]"
61syn match helpSpecial "\[ident]"
62syn match helpSpecial "\[addr]"
63syn match helpSpecial "\[group]"
64syn match helpSpecial "CTRL-."
65syn match helpSpecial "CTRL-Break"
66syn match helpSpecial "CTRL-PageUp"
67syn match helpSpecial "CTRL-PageDown"
68syn match helpSpecial "CTRL-Insert"
69syn match helpSpecial "CTRL-Del"
70syn match helpSpecial "CTRL-{char}"
71syn region helpNotVi start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump
72syn match helpLeadBlank "^\s\+" contained
73
74" Highlight group items in their own color.
75syn match helpComment "\t[* ]Comment\t\+[a-z].*"
76syn match helpConstant "\t[* ]Constant\t\+[a-z].*"
77syn match helpString "\t[* ]String\t\+[a-z].*"
78syn match helpCharacter "\t[* ]Character\t\+[a-z].*"
79syn match helpNumber "\t[* ]Number\t\+[a-z].*"
80syn match helpBoolean "\t[* ]Boolean\t\+[a-z].*"
81syn match helpFloat "\t[* ]Float\t\+[a-z].*"
82syn match helpIdentifier "\t[* ]Identifier\t\+[a-z].*"
83syn match helpFunction "\t[* ]Function\t\+[a-z].*"
84syn match helpStatement "\t[* ]Statement\t\+[a-z].*"
85syn match helpConditional "\t[* ]Conditional\t\+[a-z].*"
86syn match helpRepeat "\t[* ]Repeat\t\+[a-z].*"
87syn match helpLabel "\t[* ]Label\t\+[a-z].*"
88syn match helpOperator "\t[* ]Operator\t\+["a-z].*"
89syn match helpKeyword "\t[* ]Keyword\t\+[a-z].*"
90syn match helpException "\t[* ]Exception\t\+[a-z].*"
91syn match helpPreProc "\t[* ]PreProc\t\+[a-z].*"
92syn match helpInclude "\t[* ]Include\t\+[a-z].*"
93syn match helpDefine "\t[* ]Define\t\+[a-z].*"
94syn match helpMacro "\t[* ]Macro\t\+[a-z].*"
95syn match helpPreCondit "\t[* ]PreCondit\t\+[a-z].*"
96syn match helpType "\t[* ]Type\t\+[a-z].*"
97syn match helpStorageClass "\t[* ]StorageClass\t\+[a-z].*"
98syn match helpStructure "\t[* ]Structure\t\+[a-z].*"
99syn match helpTypedef "\t[* ]Typedef\t\+[Aa-z].*"
100syn match helpSpecial "\t[* ]Special\t\+[a-z].*"
101syn match helpSpecialChar "\t[* ]SpecialChar\t\+[a-z].*"
102syn match helpTag "\t[* ]Tag\t\+[a-z].*"
103syn match helpDelimiter "\t[* ]Delimiter\t\+[a-z].*"
104syn match helpSpecialComment "\t[* ]SpecialComment\t\+[a-z].*"
105syn match helpDebug "\t[* ]Debug\t\+[a-z].*"
106syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
107syn match helpError "\t[* ]Error\t\+[a-z].*"
108syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
109
Bram Moolenaar3991dab2006-03-27 17:01:56 +0000110syn 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 +0000111
112" Additionally load a language-specific syntax file "help_ab.vim".
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000113let s:i = match(expand("%"), '\.\a\ax$')
114if s:i > 0
115 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116endif
117
118syn sync minlines=40
119
120
121" Define the default highlighting.
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000122" Only used when an item doesn't have highlighting yet
123hi def link helpExampleStart helpIgnore
124hi def link helpIgnore Ignore
125hi def link helpHyperTextJump Subtitle
Bram Moolenaar18144c82006-04-12 21:52:12 +0000126hi def link helpBar Ignore
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000127hi def link helpHyperTextEntry String
128hi def link helpHeadline Statement
129hi def link helpHeader PreProc
130hi def link helpSectionDelim PreProc
131hi def link helpVim Identifier
132hi def link helpExample Comment
133hi def link helpOption Type
134hi def link helpNotVi Special
135hi def link helpSpecial Special
136hi def link helpNote Todo
137hi def link Subtitle Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +0000138
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000139hi def link helpComment Comment
140hi def link helpConstant Constant
141hi def link helpString String
142hi def link helpCharacter Character
143hi def link helpNumber Number
144hi def link helpBoolean Boolean
145hi def link helpFloat Float
146hi def link helpIdentifier Identifier
147hi def link helpFunction Function
148hi def link helpStatement Statement
149hi def link helpConditional Conditional
150hi def link helpRepeat Repeat
151hi def link helpLabel Label
152hi def link helpOperator Operator
153hi def link helpKeyword Keyword
154hi def link helpException Exception
155hi def link helpPreProc PreProc
156hi def link helpInclude Include
157hi def link helpDefine Define
158hi def link helpMacro Macro
159hi def link helpPreCondit PreCondit
160hi def link helpType Type
161hi def link helpStorageClass StorageClass
162hi def link helpStructure Structure
163hi def link helpTypedef Typedef
164hi def link helpSpecialChar SpecialChar
165hi def link helpTag Tag
166hi def link helpDelimiter Delimiter
167hi def link helpSpecialComment SpecialComment
168hi def link helpDebug Debug
169hi def link helpUnderlined Underlined
170hi def link helpError Error
171hi def link helpTodo Todo
Bram Moolenaare344bea2005-09-01 20:46:49 +0000172hi def link helpURL String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000173
174let b:current_syntax = "help"
175
176" vim: ts=8 sw=2