annotate runtime/syntax/rhelp.vim @ 1624:18ee39301b82 v7.2a

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 22:58:06 +0000
parents 82b5078be2dd
children 7bc41231fbc7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
1 " Vim syntax file
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
2 " Language: R Help File
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
3 " Maintainer: Johannes Ranke <jranke@uni-bremen.de>
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 842
diff changeset
4 " Last Change: 2008 Apr 10
82b5078be2dd updated for version 7.2a
vimboss
parents: 842
diff changeset
5 " Version: 0.7.1
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
6 " SVN: $Id$
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
7 " Remarks: - Now includes R syntax highlighting in the appropriate
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
8 " sections if an r.vim file is in the same directory or in the
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
9 " default debian location.
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
10 " - There is no Latex markup in equations
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
11
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
12 " Version Clears: {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
13 " For version 5.x: Clear all syntax items
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 714
diff changeset
14 " For version 6.x and 7.x: Quit when a syntax file was already loaded
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
15 if version < 600
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
16 syntax clear
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
17 elseif exists("b:current_syntax")
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
18 finish
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
19 endif
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
20
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
21 syn case match
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
22
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
23 " R help identifiers {{{
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
24 syn region rhelpIdentifier matchgroup=rhelpSection start="\\name{" end="}"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
25 syn region rhelpIdentifier matchgroup=rhelpSection start="\\alias{" end="}"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
26 syn region rhelpIdentifier matchgroup=rhelpSection start="\\pkg{" end="}"
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
27 syn region rhelpIdentifier matchgroup=rhelpSection start="\\item{" end="}" contained contains=rhelpDots
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
28 syn region rhelpIdentifier matchgroup=rhelpSection start="\\method{" end=/}/ contained
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
29
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
30 " Highlighting of R code using an existing r.vim syntax file if available {{{1
827
fd1b3406fd1c updated for version 7.0d02
vimboss
parents: 819
diff changeset
31 syn include @R syntax/r.vim
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
32 syn match rhelpDots "\\dots" containedin=@R
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
33 syn region rhelpRcode matchgroup=Delimiter start="\\examples{" matchgroup=Delimiter transparent end=/}/ contains=@R,rhelpSection
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
34 syn region rhelpRcode matchgroup=Delimiter start="\\usage{" matchgroup=Delimiter transparent end=/}/ contains=@R,rhelpIdentifier,rhelpS4method
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
35 syn region rhelpRcode matchgroup=Delimiter start="\\synopsis{" matchgroup=Delimiter transparent end=/}/ contains=@R
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
36 syn region rhelpRcode matchgroup=Delimiter start="\\special{" matchgroup=Delimiter transparent end=/}/ contains=@R contained
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 714
diff changeset
37 syn region rhelpRcode matchgroup=Delimiter start="\\code{" matchgroup=Delimiter transparent end=/}/ contains=@R,rhelpLink contained
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
38 syn region rhelpS4method matchgroup=Delimiter start="\\S4method{.*}(" matchgroup=Delimiter transparent end=/)/ contains=@R,rhelpDots contained
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
39
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
40 " Strings {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
41 syn region rhelpString start=/"/ end=/"/
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
42
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 714
diff changeset
43 " Special characters ( \$ \& \% \# \{ \} \_) {{{1
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
44 syn match rhelpSpecialChar "\\[$&%#{}_]"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
45
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
46 " Special Delimiters {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
47 syn match rhelpDelimiter "\\cr"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
48 syn match rhelpDelimiter "\\tab "
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
49
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
50 " Keywords {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
51 syn match rhelpKeyword "\\R"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
52 syn match rhelpKeyword "\\ldots"
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
53 syn match rhelpKeyword "--"
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
54 syn match rhelpKeyword "---"
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
55 syn match rhelpKeyword "<"
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
56 syn match rhelpKeyword ">"
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
57
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
58 " Links {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
59 syn region rhelpLink matchgroup=rhelpSection start="\\link{" end="}" contained keepend
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
60 syn region rhelpLink matchgroup=rhelpSection start="\\link\[.*\]{" end="}" contained keepend
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
61 syn region rhelpLink matchgroup=rhelpSection start="\\linkS4class{" end="}" contained keepend
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
62
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
63 " Type Styles {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
64 syn match rhelpType "\\emph\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
65 syn match rhelpType "\\strong\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
66 syn match rhelpType "\\bold\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
67 syn match rhelpType "\\sQuote\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
68 syn match rhelpType "\\dQuote\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
69 syn match rhelpType "\\preformatted\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
70 syn match rhelpType "\\kbd\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
71 syn match rhelpType "\\samp\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
72 syn match rhelpType "\\eqn\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
73 syn match rhelpType "\\deqn\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
74 syn match rhelpType "\\file\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
75 syn match rhelpType "\\email\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
76 syn match rhelpType "\\url\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
77 syn match rhelpType "\\var\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
78 syn match rhelpType "\\env\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
79 syn match rhelpType "\\option\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
80 syn match rhelpType "\\command\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
81 syn match rhelpType "\\dfn\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
82 syn match rhelpType "\\cite\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
83 syn match rhelpType "\\acronym\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
84
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
85 " rhelp sections {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
86 syn match rhelpSection "\\encoding\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
87 syn match rhelpSection "\\title\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
88 syn match rhelpSection "\\description\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
89 syn match rhelpSection "\\concept\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
90 syn match rhelpSection "\\arguments\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
91 syn match rhelpSection "\\details\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
92 syn match rhelpSection "\\value\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
93 syn match rhelpSection "\\references\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
94 syn match rhelpSection "\\note\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
95 syn match rhelpSection "\\author\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
96 syn match rhelpSection "\\seealso\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
97 syn match rhelpSection "\\keyword\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
98 syn match rhelpSection "\\docType\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
99 syn match rhelpSection "\\format\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
100 syn match rhelpSection "\\source\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
101 syn match rhelpSection "\\itemize\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
102 syn match rhelpSection "\\describe\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
103 syn match rhelpSection "\\enumerate\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
104 syn match rhelpSection "\\item "
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
105 syn match rhelpSection "\\item$"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
106 syn match rhelpSection "\\tabular{[lcr]*}"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
107 syn match rhelpSection "\\dontrun\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
108 syn match rhelpSection "\\dontshow\>"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
109 syn match rhelpSection "\\testonly\>"
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 842
diff changeset
110 syn match rhelpSection "\\donttest\>"
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
111
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
112 " Freely named Sections {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
113 syn region rhelpFreesec matchgroup=Delimiter start="\\section{" matchgroup=Delimiter transparent end=/}/
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
114
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
115 " R help file comments {{{1
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
116 syn match rhelpComment /%.*$/ contained
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
117
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
118 " Error {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
119 syn region rhelpRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rhelpError,rhelpBraceError,rhelpCurlyError
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
120 syn region rhelpRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rhelpError,rhelpBraceError,rhelpParenError
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
121 syn region rhelpRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rhelpError,rhelpCurlyError,rhelpParenError
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
122 syn match rhelpError /[)\]}]/
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
123 syn match rhelpBraceError /[)}]/ contained
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
124 syn match rhelpCurlyError /[)\]]/ contained
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
125 syn match rhelpParenError /[\]}]/ contained
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
126
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
127 " Define the default highlighting {{{1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
128 " For version 5.7 and earlier: only when not done already
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
129 " For version 5.8 and later: only when an item doesn't have highlighting yet
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
130 if version >= 508 || !exists("did_rhelp_syntax_inits")
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
131 if version < 508
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
132 let did_rhelp_syntax_inits = 1
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
133 command -nargs=+ HiLink hi link <args>
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
134 else
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
135 command -nargs=+ HiLink hi def link <args>
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
136 endif
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
137 HiLink rhelpIdentifier Identifier
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
138 HiLink rhelpString String
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
139 HiLink rhelpKeyword Keyword
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
140 HiLink rhelpDots Keyword
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
141 HiLink rhelpLink Underlined
842
a209672376fd updated for version 7.0f
vimboss
parents: 827
diff changeset
142 HiLink rhelpType Type
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
143 HiLink rhelpSection PreCondit
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
144 HiLink rhelpError Error
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
145 HiLink rhelpBraceError Error
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
146 HiLink rhelpCurlyError Error
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
147 HiLink rhelpParenError Error
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
148 HiLink rhelpDelimiter Delimiter
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
149 HiLink rhelpComment Comment
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
150 HiLink rhelpRComment Comment
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
151 HiLink rhelpSpecialChar SpecialChar
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
152 delcommand HiLink
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
153 endif
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
154
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
155 let b:current_syntax = "rhelp"
0f9f4761ad9c updated for version 7.0216
vimboss
parents:
diff changeset
156 " vim: foldmethod=marker: