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