blob: c511a58e475fb6b86487dce89ac74c9f11fe821b [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 Moolenaar7b89edc2006-04-06 20:21:51 +00004" Last Change: 2006 Apr 06
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")
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
Bram Moolenaar3991dab2006-03-27 17:01:56 +0000109syn 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 +0000110
111" Additionally load a language-specific syntax file "help_ab.vim".
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000112let s:i = match(expand("%"), '\.\a\ax$')
113if s:i > 0
114 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115endif
116
117syn sync minlines=40
118
119
120" Define the default highlighting.
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000121" Only used when an item doesn't have highlighting yet
122hi def link helpExampleStart helpIgnore
123hi def link helpIgnore Ignore
124hi def link helpHyperTextJump Subtitle
125hi def link helpHyperTextEntry String
126hi def link helpHeadline Statement
127hi def link helpHeader PreProc
128hi def link helpSectionDelim PreProc
129hi def link helpVim Identifier
130hi def link helpExample Comment
131hi def link helpOption Type
132hi def link helpNotVi Special
133hi def link helpSpecial Special
134hi def link helpNote Todo
135hi def link Subtitle Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +0000136
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000137hi def link helpComment Comment
138hi def link helpConstant Constant
139hi def link helpString String
140hi def link helpCharacter Character
141hi def link helpNumber Number
142hi def link helpBoolean Boolean
143hi def link helpFloat Float
144hi def link helpIdentifier Identifier
145hi def link helpFunction Function
146hi def link helpStatement Statement
147hi def link helpConditional Conditional
148hi def link helpRepeat Repeat
149hi def link helpLabel Label
150hi def link helpOperator Operator
151hi def link helpKeyword Keyword
152hi def link helpException Exception
153hi def link helpPreProc PreProc
154hi def link helpInclude Include
155hi def link helpDefine Define
156hi def link helpMacro Macro
157hi def link helpPreCondit PreCondit
158hi def link helpType Type
159hi def link helpStorageClass StorageClass
160hi def link helpStructure Structure
161hi def link helpTypedef Typedef
162hi def link helpSpecialChar SpecialChar
163hi def link helpTag Tag
164hi def link helpDelimiter Delimiter
165hi def link helpSpecialComment SpecialComment
166hi def link helpDebug Debug
167hi def link helpUnderlined Underlined
168hi def link helpError Error
169hi def link helpTodo Todo
Bram Moolenaare344bea2005-09-01 20:46:49 +0000170hi def link helpURL String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000171
172let b:current_syntax = "help"
173
174" vim: ts=8 sw=2