From 483c5d80a708a81edd96f8241c231a29e5c58a2f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 20 Oct 2010 18:45:33 +0200 Subject: Updated runtime files and translations. --- runtime/syntax/gpg.vim | 4 +- runtime/syntax/r.vim | 178 +++++++++++++++++++++++++++--------------------- runtime/syntax/yaml.vim | 4 +- 3 files changed, 106 insertions(+), 80 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/gpg.vim b/runtime/syntax/gpg.vim index 0f73b17a72..cde21ee563 100644 --- a/runtime/syntax/gpg.vim +++ b/runtime/syntax/gpg.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: gpg(1) configuration file " Maintainer: Nikolai Weibull -" Latest Revision: 2007-06-17 +" Latest Revision: 2010-10-14 if exists("b:current_syntax") finish @@ -54,7 +54,7 @@ syn keyword gpgOption contained skipwhite nextgroup=gpgArg \ personal-digest-preferences photo-viewer \ recipient s2k-cipher-algo s2k-digest-algo s2k-mode \ secret-keyring set-filename set-policy-url status-fd - \ trusted-key verify-options + \ trusted-key verify-options keyid-format list-options syn keyword gpgOption contained skipwhite nextgroup=gpgArgError \ allow-freeform-uid allow-non-selfsigned-uid \ allow-secret-key-import always-trust diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim index f3e730ef92..7d98e92b74 100644 --- a/runtime/syntax/r.vim +++ b/runtime/syntax/r.vim @@ -1,111 +1,137 @@ " Vim syntax file -" Language: R (GNU S) -" Maintainer: Vaidotas Zemlys -" Last Change: 2006 Apr 30 -" Filenames: *.R *.Rout *.r *.Rhistory *.Rt *.Rout.save *.Rout.fail -" URL: http://uosis.mif.vu.lt/~zemlys/vim-syntax/r.vim - -" First maintainer Tom Payne -" Modified to make syntax less colourful and added the highlighting of -" R assignment arrow - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" Language: R (GNU S) +" Maintainer: Jakson Aquino +" Former Maintainers: Vaidotas Zemlys +" Tom Payne +" Last Change: Wed Sep 29, 2010 09:31AM +" Filenames: *.R *.r *.Rhistory *.Rt +" +" NOTE: The highlighting of R functions is defined in the +" r-plugin/functions.vim, which is part of vim-r-plugin2: +" http://www.vim.org/scripts/script.php?script_id=2628 +" +" Some lines of code were borrowed from Zhuojun Chen. + +if exists("b:current_syntax") finish endif -if version >= 600 - setlocal iskeyword=@,48-57,_,. -else - set iskeyword=@,48-57,_,. -endif +setlocal iskeyword=@,48-57,_,. syn case match " Comment -syn match rComment /\#.*/ +syn match rComment contains=@Spell "\#.*" -" Constant " string enclosed in double quotes -syn region rString start=/"/ skip=/\\\\\|\\"/ end=/"/ +syn region rString contains=rSpecial,rStrError,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/ " string enclosed in single quotes -syn region rString start=/'/ skip=/\\\\\|\\'/ end=/'/ -" number with no fractional part or exponent -syn match rNumber /\d\+/ -" floating point number with integer and fractional parts and optional exponent -syn match rFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/ -" floating point number with no integer part and optional exponent -syn match rFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/ -" floating point number with no fractional part and optional exponent -syn match rFloat /\d\+[Ee][-+]\=\d\+/ +syn region rString contains=rSpecial,rStrError,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/ + +syn match rStrError display contained "\\." + +" New line, carriage return, tab, backspace, bell, feed, vertical tab, backslash +syn match rSpecial display contained "\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\" -" Identifier -" identifier with leading letter and optional following keyword characters -syn match rIdentifier /\a\k*/ -" identifier with leading period, one or more digits, and at least one non-digit keyword character -syn match rIdentifier /\.\d*\K\k*/ +" Hexadecimal and Octal digits +syn match rSpecial display contained "\\\(x\x\{1,2}\|[0-8]\{1,3}\)" + +" Unicode characters +syn match rSpecial display contained "\\u\x\{1,4}" +syn match rSpecial display contained "\\U\x\{1,8}" +syn match rSpecial display contained "\\u{\x\{1,4}}" +syn match rSpecial display contained "\\U{\x\{1,8}}" + + +syn match rDollar "\$" " Statement syn keyword rStatement break next return syn keyword rConditional if else syn keyword rRepeat for in repeat while +" Constant (not really) +syn keyword rConstant T F LETTERS letters month.ab month.name pi +syn keyword rConstant R.version.string + " Constant -syn keyword rConstant LETTERS letters month.ab month.name pi syn keyword rConstant NULL syn keyword rBoolean FALSE TRUE -syn keyword rNumber NA -syn match rArrow /<\{1,2}-/ +syn keyword rNumber NA NA_integer_ NA_real_ NA_complex_ NA_character_ +syn keyword rNumber Inf NaN -" Type -syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame +" integer +syn match rInteger "\<\d\+L" +syn match rInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L" +syn match rInteger "\<\d\+[Ee]+\=\d\+L" + +syn match rOperator "[\*\!\&\+\-\<\>\=\^\|\~\`/:@]" +syn match rOperator "%\{2}\|%\*%\|%\/%\|%in%\|%o%\|%x%" + +syn match rComplex "\<\d\+i" +syn match rComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i" +syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i" +syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i" +syn match rComplex "\<\d\+[Ee][-+]\=\d\+i" + +" number with no fractional part or exponent +syn match rNumber "\<\d\+\>" +" hexadecimal number +syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+" + +" floating point number with integer and fractional parts and optional exponent +syn match rFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=" +" floating point number with no integer part and optional exponent +syn match rFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\=" +" floating point number with no fractional part and optional exponent +syn match rFloat "\<\d\+[Ee][-+]\=\d\+" + +syn match rArrow "<\{1,2}-" +syn match rArrow "->\{1,2}" " Special -syn match rDelimiter /[,;:]/ +syn match rDelimiter "[,;:]" " Error syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError -syn match rError /[)\]}]/ -syn match rBraceError /[)}]/ contained -syn match rCurlyError /[)\]]/ contained -syn match rParenError /[\]}]/ contained +syn match rError "[)\]}]" +syn match rBraceError "[)}]" contained +syn match rCurlyError "[)\]]" contained +syn match rParenError "[\]}]" contained + +" Functions that may add new objects +syn keyword rPreProc library require attach detach source + +" Type +syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_r_syn_inits") - if version < 508 - let did_r_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink rComment Comment - HiLink rConstant Constant - HiLink rString String - HiLink rNumber Number - HiLink rBoolean Boolean - HiLink rFloat Float - HiLink rStatement Statement - HiLink rConditional Conditional - HiLink rRepeat Repeat - HiLink rIdentifier Normal - HiLink rArrow Statement - HiLink rType Type - HiLink rDelimiter Delimiter - HiLink rError Error - HiLink rBraceError Error - HiLink rCurlyError Error - HiLink rParenError Error - delcommand HiLink -endif +hi def link rArrow Statement +hi def link rBoolean Boolean +hi def link rBraceError Error +hi def link rComment Comment +hi def link rComplex Number +hi def link rConditional Conditional +hi def link rConstant Constant +hi def link rCurlyError Error +hi def link rDelimiter Delimiter +hi def link rDollar SpecialChar +hi def link rError Error +hi def link rFloat Float +hi def link rInteger Number +hi def link rNumber Number +hi def link rOperator Operator +hi def link rParenError Error +hi def link rPreProc PreProc +hi def link rRepeat Repeat +hi def link rSpecial SpecialChar +hi def link rStatement Statement +hi def link rString String +hi def link rStrError Error +hi def link rType Type let b:current_syntax="r" " vim: ts=8 sw=2 - diff --git a/runtime/syntax/yaml.vim b/runtime/syntax/yaml.vim index ba8906dfc4..1e54aff382 100644 --- a/runtime/syntax/yaml.vim +++ b/runtime/syntax/yaml.vim @@ -2,7 +2,7 @@ " Language: YAML (YAML Ain't Markup Language) 1.2 " Maintainer: Nikolai Pavlov " First author: Nikolai Weibull -" Latest Revision: 2010-09-16 +" Latest Revision: 2010-10-08 if exists('b:current_syntax') finish @@ -124,7 +124,7 @@ syn match yamlConstant '\<\~\>' syn match yamlTimestamp /\%([\[\]{}, \t]\@!\p\)\@