1
0
forked from aniani/vim

Update runtime files

This commit is contained in:
Bram Moolenaar
2021-04-21 18:09:37 +02:00
parent 459fbdbf92
commit 11e3c5ba82
24 changed files with 2367 additions and 2410 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
" Tom Payne <tom@tompayne.org>
" Contributor: Johannes Ranke <jranke@uni-bremen.de>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Wed Aug 01, 2018 10:10PM
" Last Change: Sun Mar 28, 2021 01:47PM
" Filenames: *.R *.r *.Rhistory *.Rt
"
" NOTE: The highlighting of R functions might be defined in
@@ -53,12 +53,12 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
syn match rTodoParen contained "\(BUG\|FIXME\|NOTE\|TODO\)\s*(.\{-})\s*:" contains=rTodoKeyw,rTodoInfo transparent
syn keyword rTodoKeyw BUG FIXME NOTE TODO contained
syn match rTodoInfo "(\zs.\{-}\ze)" contained
syn match rComment contains=@Spell,rCommentTodo,rTodoParen,rOBlock "#.*"
syn match rComment contains=@Spell,rCommentTodo,rTodoParen "#.*"
" Roxygen
if g:r_syntax_hl_roxygen
" A roxygen block can start at the beginning of a file (first version) and
" after a blank line (second version). It ends when a line that does not
" after a blank line (second version). It ends when a line appears that does not
" contain a roxygen comment. In the following comments, any line containing
" a roxygen comment marker (one or two hash signs # followed by a single
" quote ' and preceded only by whitespace) is called a roxygen line. A
@@ -71,6 +71,12 @@ if g:r_syntax_hl_roxygen
syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
" A title as part of a block is always at the beginning of the block, i.e.
" either at the start of a file or after a completely empty line.
syn match rOTitle "\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitleTag contained "@title"
" When a roxygen block has a title and additional content, the title
" consists of one or more roxygen lines (as little as possible are matched),
" followed either by an empty roxygen line
@@ -87,16 +93,15 @@ if g:r_syntax_hl_roxygen
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
" A title as part of a block is always at the beginning of the block, i.e.
" either at the start of a file or after a completely empty line.
syn match rOTitle "\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitleTag contained "@title"
syn match rOCommentKey "^\s*#\{1,2}'" contained
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold
syn region rOExamples start="^\s*#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold
" rOTag list generated from the lists in
" R6 classes may contain roxygen lines independent of roxygen blocks
syn region rOR6Class start=/R6Class(/ end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold
syn match rOR6Block "#\{1,2}'.*" contains=rOTag,rOExamples,@Spell containedin=rOR6Class contained
syn match rOR6Block "^\s*#\{1,2}'.*" contains=rOTag,rOExamples,@Spell containedin=rOR6Class contained
" rOTag list originally generated from the lists that were available in
" https://github.com/klutometis/roxygen/R/rd.R and
" https://github.com/klutometis/roxygen/R/namespace.R
" using s/^ \([A-Za-z0-9]*\) = .*/ syn match rOTag contained "@\1"/
@@ -155,7 +160,10 @@ if g:r_syntax_hl_roxygen
syn match rOTag contained "@S3method"
syn match rOTag contained "@useDynLib"
" other
syn match rOTag contained "@eval"
syn match rOTag contained "@include"
syn match rOTag contained "@includeRmd"
syn match rOTag contained "@order"
endif
@@ -186,6 +194,11 @@ 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}}"
" Raw string
syn region rRawString matchgroup=rRawStrDelim start=/[rR]\z(['"]\)\z(-*\)(/ end=/)\z2\z1/ keepend
syn region rRawString matchgroup=rRawStrDelim start=/[rR]\z(['"]\)\z(-*\){/ end=/}\z2\z1/ keepend
syn region rRawString matchgroup=rRawStrDelim start=/[rR]\z(['"]\)\z(-*\)\[/ end=/\]\z2\z1/ keepend
" Statement
syn keyword rStatement break next return
syn keyword rConditional if else
@@ -354,6 +367,8 @@ hi def link rOperator Operator
hi def link rOpError Error
hi def link rParenError Error
hi def link rPreProc PreProc
hi def link rRawString String
hi def link rRawStrDelim Delimiter
hi def link rRepeat Repeat
hi def link rSpecial SpecialChar
hi def link rStatement Statement
@@ -366,6 +381,7 @@ if g:r_syntax_hl_roxygen
hi def link rOTitleBlock Title
hi def link rOBlock Comment
hi def link rOBlockNoTitle Comment
hi def link rOR6Block Comment
hi def link rOTitle Title
hi def link rOCommentKey Comment
hi def link rOExamples SpecialComment

1971
runtime/syntax/raku.vim Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
" markdown Text with R statements
" Language: markdown with R code chunks
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Thu Apr 18, 2019 09:17PM
" Last Change: Wed Apr 21, 2021 09:55AM
"
" For highlighting pandoc extensions to markdown like citations and TeX and
" many other advanced features like folding of markdown sections, it is
@@ -13,27 +13,45 @@ if exists("b:current_syntax")
finish
endif
" Configuration if not using pandoc syntax:
" Add syntax highlighting of YAML header
let g:rmd_syn_hl_yaml = get(g:, 'rmd_syn_hl_yaml', 1)
" Add syntax highlighting of citation keys
let g:rmd_syn_hl_citations = get(g:, 'rmd_syn_hl_citations', 1)
" Highlight the header of the chunk of R code
let g:rmd_syn_hl_chunk = get(g:, 'g:rmd_syn_hl_chunk', 0)
" Highlight the header of the chunks as R code
let g:rmd_syn_hl_chunk = get(g:, 'rmd_syn_hl_chunk', 0)
" Pandoc-syntax has more features, but it is slower.
" https://github.com/vim-pandoc/vim-pandoc-syntax
let g:pandoc#syntax#codeblocks#embeds#langs = get(g:, 'pandoc#syntax#codeblocks#embeds#langs', ['r'])
runtime syntax/pandoc.vim
if exists("b:current_syntax")
" Fix recognition of R code
syn region pandocDelimitedCodeBlock_r start=/^```{r\>.*}$/ end=/^```$/ contained containedin=pandocDelimitedCodeBlock contains=@R
" Recognize inline R code
syn region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend
hi def link rmdInlineDelim Delimiter
" Fix recognition of language chunks (code adapted from pandoc, 2021-03-28)
" Knitr requires braces in the block's header
for s:lng in g:pandoc#syntax#codeblocks#embeds#langs
let s:nm = matchstr(s:lng, '^[^=]*')
exe 'syn clear pandocDelimitedCodeBlock_'.s:nm
exe 'syn clear pandocDelimitedCodeBlockinBlockQuote_'.s:nm
if g:rmd_syn_hl_chunk
exe 'syn region rmd'.s:nm.'ChunkDelim matchgroup=rmdCodeDelim start="^\s*```\s*{\s*'.s:nm.'\>" matchgroup=rmdCodeDelim end="}$" keepend containedin=rmd'.s:nm.'Chunk contains=@R'
exe 'syn region rmd'.s:nm.'Chunk start="^\s*```\s*{\s*'.s:nm.'\>.*$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend contains=rmd'.s:nm.'ChunkDelim,@'.toupper(s:nm)
else
exe 'syn region rmd'.s:nm.'Chunk matchgroup=rmdCodeDelim start="^\s*```\s*{\s*'.s:nm.'\>.*$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend contains=@'.toupper(s:nm)
endif
endfor
unlet s:lng
unlet s:nm
hi def link rmdInlineDelim Delimiter
hi def link rmdCodeDelim Delimiter
let b:current_syntax = "rmd"
finish
endif
" Configuration if not using pandoc syntax:
" Add syntax highlighting of YAML header
let g:rmd_syn_hl_yaml = get(g:, 'rmd_syn_hl_yaml', 1)
" Add syntax highlighting of citation keys
let g:rmd_syn_hl_citations = get(g:, 'rmd_syn_hl_citations', 1)
let s:cpo_save = &cpo
set cpo&vim
@@ -63,15 +81,17 @@ for s:type in g:rmd_fenced_languages
unlet! b:current_syntax
exe 'syn include @Rmd'.s:nm.' syntax/'.s:ft.'.vim'
if g:rmd_syn_hl_chunk
exe 'syn region rmd'.s:nm.'ChunkDelim matchgroup=rmdCodeDelim start="^\s*```\s*{\s*'.s:nm.'\>" matchgroup=rmdCodeDelim end="}$" keepend containedin=rmd'.s:nm.'Chunk contains=@Rmd'.s:nm
exe 'syn region rmd'.s:nm.'ChunkDelim matchgroup=rmdCodeDelim start="^\s*```\s*{\s*'.s:nm.'\>" matchgroup=rmdCodeDelim end="}$" keepend containedin=rmd'.s:nm.'Chunk contains=@Rmdr'
exe 'syn region rmd'.s:nm.'Chunk start="^\s*```\s*{\s*'.s:nm.'\>.*$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend contains=rmd'.s:nm.'ChunkDelim,@Rmd'.s:nm
else
exe 'syn region rmd'.s:nm.'Chunk matchgroup=rmdCodeDelim start="^\s*```\s*{\s*'.s:nm.'\>.*$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend contains=@Rmd'.s:nm
endif
exe 'syn region rmd'.s:nm.'Inline matchgroup=rmdInlineDelim start="`'.s:nm.' " end="`" contains=@Rmd'.s:nm.' keepend'
endfor
unlet! s:type
" Recognize inline R code
syn region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@Rmdr keepend
hi def link rmdInlineDelim Delimiter
hi def link rmdCodeDelim Delimiter

View File

@@ -33,8 +33,8 @@ syn cluster texParaGroup add=@rnoweb
" Highlighting of R code using an existing r.vim syntax file if available {{{1
syn include @rnowebR syntax/r.vim
syn region rnowebChunk matchgroup=rnowebDelimiter start="^<<.*>>=" matchgroup=rnowebDelimiter end="^@" contains=@rnowebR,rnowebChunkReference,rnowebChunk fold keepend
syn match rnowebChunkReference "^<<.*>>$" contained
syn region rnowebChunk matchgroup=rnowebDelimiter start="^\s*<<.*>>=" matchgroup=rnowebDelimiter end="^@" contains=@rnowebR,rnowebChunkReference,rnowebChunk fold keepend
syn match rnowebChunkReference "^\s*<<.*>>$" contained
syn region rnowebSexpr matchgroup=Delimiter start="\\Sexpr{" matchgroup=Delimiter end="}" contains=@rnowebR contained
" Sweave options command {{{1