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