diff options
author | James McCoy <jamessan@jamessan.com> | 2016-06-20 10:37:19 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-07-08 01:43:36 -0400 |
commit | ea18b4a60f3b89d261c46b030d3d026ddad864bb (patch) | |
tree | e853d1a1306f9b636d4eb183487a4458283e249f /runtime/syntax/r.vim | |
parent | 1f54d253e169fbc483cc485f9b3092a8da1f62db (diff) | |
download | rneovim-ea18b4a60f3b89d261c46b030d3d026ddad864bb.tar.gz rneovim-ea18b4a60f3b89d261c46b030d3d026ddad864bb.tar.bz2 rneovim-ea18b4a60f3b89d261c46b030d3d026ddad864bb.zip |
vim-patch:77cdfd1
Updated runtime files.
https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Ignore changes to:
* doc/channel.txt, doc/eval.txt: Channel related docs
* doc/options.txt: GUI related docs
* doc/tags: Generated at build time
* doc/todo.txt: Irrelevant for Neovim
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 e48b6686cb..d96bf96acb 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" |