diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-12 12:57:59 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-12 12:57:59 +0100 |
commit | 77cdfd10382e01cc51f4ba1a9177032351843151 (patch) | |
tree | 9d9e20ee5c80d402d8f853ca0d88b6db6a53e5ed /runtime/syntax/r.vim | |
parent | 4fc563b397949ce23190045112fa08c0776a56e6 (diff) | |
download | vim-git-77cdfd10382e01cc51f4ba1a9177032351843151.tar.gz |
Updated runtime files.
Diffstat (limited to 'runtime/syntax/r.vim')
-rw-r--r-- | runtime/syntax/r.vim | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim index e48b6686c..d96bf96ac 100644 --- a/runtime/syntax/r.vim +++ b/runtime/syntax/r.vim @@ -5,17 +5,21 @@ " Tom Payne <tom@tompayne.org> " Contributor: Johannes Ranke <jranke@uni-bremen.de> " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Wed Oct 21, 2015 06:33AM +" Last Change: Thu Mar 10, 2016 12:26PM " Filenames: *.R *.r *.Rhistory *.Rt " " NOTE: The highlighting of R functions is defined in " runtime files created by a filetype plugin, if installed. " " CONFIGURATION: -" syntax folding can be turned on by +" Syntax folding can be turned on by " " let r_syntax_folding = 1 " +" ROxygen highlighting can be turned off by +" +" let r_hl_roxygen = 0 +" " Some lines of code were borrowed from Zhuojun Chen. if exists("b:current_syntax") @@ -24,9 +28,12 @@ endif setlocal iskeyword=@,48-57,_,. -if exists("g:r_syntax_folding") +if exists("g:r_syntax_folding") && g:r_syntax_folding setlocal foldmethod=syntax endif +if !exists("g:r_hl_roxygen") + let g:r_hl_roxygen = 1 +endif syn case match @@ -35,18 +42,20 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):" syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*" " Roxygen -syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend -syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey -syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained - -syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword - -syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)" -syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)" -syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)" -syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)" -syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)" -syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)" +if g:r_hl_roxygen + syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend + syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey + syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained + + syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword + + syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)" + syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)" + syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)" + syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)" + syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)" + syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)" +endif if &filetype == "rhelp" @@ -159,12 +168,13 @@ syn match rBraceError "[)}]" contained syn match rCurlyError "[)\]]" contained syn match rParenError "[\]}]" contained -" Source list of R functions produced by a filetype plugin (if installed) -if has("nvim") - " Nvim-R +if !exists("g:R_hi_fun") + let g:R_hi_fun = 1 +endif +if g:R_hi_fun + " Nvim-R: runtime R/functions.vim -else - " Vim-R-plugin + " Vim-R-plugin: runtime r-plugin/functions.vim endif @@ -235,11 +245,13 @@ hi def link rStatement Statement hi def link rString String hi def link rStrError Error hi def link rType Type -hi def link rOKeyword Title -hi def link rOBlock Comment -hi def link rOTitle Title -hi def link rOCommentKey Comment -hi def link rOExamples SpecialComment +if g:r_hl_roxygen + hi def link rOKeyword Title + hi def link rOBlock Comment + hi def link rOTitle Title + hi def link rOCommentKey Comment + hi def link rOExamples SpecialComment +endif let b:current_syntax="r" |