Mercurial > vim
annotate runtime/syntax/r.vim @ 9851:eafd017d8a5a
Added tag v7.4.2200 for changeset 67781bb0a61a55adea7ed2394daddbb2e838046e
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 12 Aug 2016 16:30:07 +0200 |
parents | da01d5da2cfa |
children | 03fa8a51e9dc |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
2 " Language: R (GNU S) |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
3 " Maintainer: Jakson Aquino <jalvesaq@gmail.com> |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
4 " Former Maintainers: Vaidotas Zemlys <zemlys@gmail.com> |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
5 " Tom Payne <tom@tompayne.org> |
7315
444efa5f5015
commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
6 " Contributor: Johannes Ranke <jranke@uni-bremen.de> |
444efa5f5015
commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
7 " Homepage: https://github.com/jalvesaq/R-Vim-runtime |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
8 " Last Change: Thu Mar 10, 2016 12:26PM |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
9 " Filenames: *.R *.r *.Rhistory *.Rt |
6476 | 10 " |
11 " NOTE: The highlighting of R functions is defined in | |
12 " runtime files created by a filetype plugin, if installed. | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
13 " |
2725 | 14 " CONFIGURATION: |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
15 " Syntax folding can be turned on by |
2725 | 16 " |
17 " let r_syntax_folding = 1 | |
18 " | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
19 " ROxygen highlighting can be turned off by |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
20 " |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
21 " let r_hl_roxygen = 0 |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
22 " |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
23 " Some lines of code were borrowed from Zhuojun Chen. |
625 | 24 |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
25 if exists("b:current_syntax") |
7 | 26 finish |
27 endif | |
28 | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
29 setlocal iskeyword=@,48-57,_,. |
7 | 30 |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
31 if exists("g:r_syntax_folding") && g:r_syntax_folding |
2725 | 32 setlocal foldmethod=syntax |
33 endif | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
34 if !exists("g:r_hl_roxygen") |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
35 let g:r_hl_roxygen = 1 |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
36 endif |
2725 | 37 |
7 | 38 syn case match |
39 | |
40 " Comment | |
6051 | 41 syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):" |
7315
444efa5f5015
commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
42 syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*" |
4780 | 43 |
44 " Roxygen | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
45 if g:r_hl_roxygen |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
46 syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
47 syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
48 syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained |
7315
444efa5f5015
commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
49 |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
50 syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword |
7315
444efa5f5015
commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
51 |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
52 syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)" |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
53 syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)" |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
54 syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)" |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
55 syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)" |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
56 syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)" |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
57 syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)" |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
58 endif |
4780 | 59 |
7 | 60 |
2725 | 61 if &filetype == "rhelp" |
62 " string enclosed in double quotes | |
63 syn region rString contains=rSpecial,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/ | |
64 " string enclosed in single quotes | |
65 syn region rString contains=rSpecial,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/ | |
66 else | |
67 " string enclosed in double quotes | |
68 syn region rString contains=rSpecial,rStrError,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/ | |
69 " string enclosed in single quotes | |
70 syn region rString contains=rSpecial,rStrError,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/ | |
71 endif | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
72 |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
73 syn match rStrError display contained "\\." |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
74 |
2725 | 75 |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
76 " New line, carriage return, tab, backspace, bell, feed, vertical tab, backslash |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
77 syn match rSpecial display contained "\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\" |
7 | 78 |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
79 " Hexadecimal and Octal digits |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
80 syn match rSpecial display contained "\\\(x\x\{1,2}\|[0-8]\{1,3}\)" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
81 |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
82 " Unicode characters |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
83 syn match rSpecial display contained "\\u\x\{1,4}" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
84 syn match rSpecial display contained "\\U\x\{1,8}" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
85 syn match rSpecial display contained "\\u{\x\{1,4}}" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
86 syn match rSpecial display contained "\\U{\x\{1,8}}" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
87 |
7 | 88 " Statement |
89 syn keyword rStatement break next return | |
90 syn keyword rConditional if else | |
91 syn keyword rRepeat for in repeat while | |
92 | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
93 " Constant (not really) |
4780 | 94 syn keyword rConstant T F LETTERS letters month.abb month.name pi |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
95 syn keyword rConstant R.version.string |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
96 |
6476 | 97 syn keyword rNumber NA_integer_ NA_real_ NA_complex_ NA_character_ |
2725 | 98 |
99 " Constants | |
7 | 100 syn keyword rConstant NULL |
101 syn keyword rBoolean FALSE TRUE | |
6476 | 102 syn keyword rNumber NA Inf NaN |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
103 |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
104 " integer |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
105 syn match rInteger "\<\d\+L" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
106 syn match rInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
107 syn match rInteger "\<\d\+[Ee]+\=\d\+L" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
108 |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
109 " number with no fractional part or exponent |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
110 syn match rNumber "\<\d\+\>" |
6476 | 111 " hexadecimal number |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
112 syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
113 |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
114 " floating point number with integer and fractional parts and optional exponent |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
115 syn match rFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
116 " floating point number with no integer part and optional exponent |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
117 syn match rFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\=" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
118 " floating point number with no fractional part and optional exponent |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
119 syn match rFloat "\<\d\+[Ee][-+]\=\d\+" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
120 |
2725 | 121 " complex number |
122 syn match rComplex "\<\d\+i" | |
123 syn match rComplex "\<\d\++\d\+i" | |
124 syn match rComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i" | |
125 syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i" | |
126 syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i" | |
127 syn match rComplex "\<\d\+[Ee][-+]\=\d\+i" | |
128 | |
6476 | 129 syn match rAssign '=' |
2725 | 130 syn match rOperator "&" |
131 syn match rOperator '-' | |
4502
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2725
diff
changeset
|
132 syn match rOperator '\*' |
2725 | 133 syn match rOperator '+' |
4780 | 134 if &filetype != "rmd" && &filetype != "rrst" |
135 syn match rOperator "[|!<>^~/:]" | |
136 else | |
137 syn match rOperator "[|!<>^~`/:]" | |
138 endif | |
6051 | 139 syn match rOperator "%\{2}\|%\S\{-}%" |
6476 | 140 syn match rOperator '\([!><]\)\@<==' |
141 syn match rOperator '==' | |
4780 | 142 syn match rOpError '\*\{3}' |
2725 | 143 syn match rOpError '//' |
144 syn match rOpError '&&&' | |
145 syn match rOpError '|||' | |
146 syn match rOpError '<<' | |
147 syn match rOpError '>>' | |
148 | |
6476 | 149 syn match rAssign "<\{1,2}-" |
150 syn match rAssign "->\{1,2}" | |
7 | 151 |
152 " Special | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
153 syn match rDelimiter "[,;:]" |
7 | 154 |
155 " Error | |
2725 | 156 if exists("g:r_syntax_folding") |
157 syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold | |
158 syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError fold | |
159 syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError fold | |
160 else | |
161 syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError | |
162 syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError | |
163 syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError | |
164 endif | |
165 | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
166 syn match rError "[)\]}]" |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
167 syn match rBraceError "[)}]" contained |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
168 syn match rCurlyError "[)\]]" contained |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
169 syn match rParenError "[\]}]" contained |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
170 |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
171 if !exists("g:R_hi_fun") |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
172 let g:R_hi_fun = 1 |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
173 endif |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
174 if g:R_hi_fun |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
175 " Nvim-R: |
6476 | 176 runtime R/functions.vim |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
177 " Vim-R-plugin: |
6476 | 178 runtime r-plugin/functions.vim |
179 endif | |
2725 | 180 |
181 syn match rDollar display contained "\$" | |
4780 | 182 syn match rDollar display contained "@" |
2725 | 183 |
184 " List elements will not be highlighted as functions: | |
185 syn match rLstElmt "\$[a-zA-Z0-9\\._]*" contains=rDollar | |
4780 | 186 syn match rLstElmt "@[a-zA-Z0-9\\._]*" contains=rDollar |
2725 | 187 |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
188 " Functions that may add new objects |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
189 syn keyword rPreProc library require attach detach source |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
190 |
2725 | 191 if &filetype == "rhelp" |
6051 | 192 syn match rHelpIdent '\\method' |
193 syn match rHelpIdent '\\S4method' | |
2725 | 194 endif |
195 | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
196 " Type |
6476 | 197 syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame |
7 | 198 |
2725 | 199 " Name of object with spaces |
4780 | 200 if &filetype != "rmd" && &filetype != "rrst" |
201 syn region rNameWSpace start="`" end="`" | |
202 endif | |
2725 | 203 |
204 if &filetype == "rhelp" | |
6476 | 205 syn match rhPreProc "^#ifdef.*" |
206 syn match rhPreProc "^#endif.*" | |
2725 | 207 syn match rhSection "\\dontrun\>" |
208 endif | |
209 | |
6476 | 210 if exists("r_syn_minlines") |
211 exe "syn sync minlines=" . r_syn_minlines | |
212 else | |
213 syn sync minlines=40 | |
214 endif | |
215 | |
7 | 216 " Define the default highlighting. |
6476 | 217 hi def link rAssign Statement |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
218 hi def link rBoolean Boolean |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
219 hi def link rBraceError Error |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
220 hi def link rComment Comment |
6051 | 221 hi def link rCommentTodo Todo |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
222 hi def link rComplex Number |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
223 hi def link rConditional Conditional |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
224 hi def link rConstant Constant |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
225 hi def link rCurlyError Error |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
226 hi def link rDelimiter Delimiter |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
227 hi def link rDollar SpecialChar |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
228 hi def link rError Error |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
229 hi def link rFloat Float |
2725 | 230 hi def link rFunction Function |
231 hi def link rHelpIdent Identifier | |
232 hi def link rhPreProc PreProc | |
233 hi def link rhSection PreCondit | |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
234 hi def link rInteger Number |
6476 | 235 hi def link rLstElmt Normal |
2725 | 236 hi def link rNameWSpace Normal |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
237 hi def link rNumber Number |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
238 hi def link rOperator Operator |
2725 | 239 hi def link rOpError Error |
2608
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
240 hi def link rParenError Error |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
241 hi def link rPreProc PreProc |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
242 hi def link rRepeat Repeat |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
243 hi def link rSpecial SpecialChar |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
244 hi def link rStatement Statement |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
245 hi def link rString String |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
246 hi def link rStrError Error |
7d8af31066c8
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
856
diff
changeset
|
247 hi def link rType Type |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
248 if g:r_hl_roxygen |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
249 hi def link rOKeyword Title |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
250 hi def link rOBlock Comment |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
251 hi def link rOTitle Title |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
252 hi def link rOCommentKey Comment |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
253 hi def link rOExamples SpecialComment |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
7315
diff
changeset
|
254 endif |
7315
444efa5f5015
commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
255 |
7 | 256 |
257 let b:current_syntax="r" | |
258 | |
259 " vim: ts=8 sw=2 |