blob: 749860a3fe8359085d7a40cfe845865092818e61 [file] [log] [blame]
Bram Moolenaarc1e37902006-04-18 21:55:01 +00001" Vim syntax file
2" Language: R noweb Files
3" Maintainer: Johannes Ranke <jranke@uni-bremen.de>
Bram Moolenaarfc65cab2018-08-28 22:58:02 +02004" Last Change: Thu Apr 05, 2018 11:06PM
Bram Moolenaar77cdfd12016-03-12 12:57:59 +01005" Version: 0.9.1
Bram Moolenaarc1e37902006-04-18 21:55:01 +00006" Remarks: - This file is inspired by the proposal of
Bram Moolenaar77cdfd12016-03-12 12:57:59 +01007" Fernando Henrique Ferraz Pereira da Rosa <feferraz@ime.usp.br>
8" http://www.ime.usp.br/~feferraz/en/sweavevim.html
Bram Moolenaarc1e37902006-04-18 21:55:01 +00009"
10
Bram Moolenaar77cdfd12016-03-12 12:57:59 +010011if exists("b:current_syntax")
Bram Moolenaarc1e37902006-04-18 21:55:01 +000012 finish
13endif
14
15syn case match
16
Bram Moolenaar313b7232007-05-05 17:56:55 +000017" Extension of Tex clusters {{{1
Bram Moolenaarc1e37902006-04-18 21:55:01 +000018runtime syntax/tex.vim
Bram Moolenaarfc65cab2018-08-28 22:58:02 +020019unlet! b:current_syntax
Bram Moolenaarc1e37902006-04-18 21:55:01 +000020
Bram Moolenaar313b7232007-05-05 17:56:55 +000021syn cluster texMatchGroup add=@rnoweb
Bram Moolenaar5c736222010-01-06 20:54:52 +010022syn cluster texMathMatchGroup add=rnowebSexpr
Bram Moolenaar77cdfd12016-03-12 12:57:59 +010023syn cluster texMathZoneGroup add=rnowebSexpr
Bram Moolenaar313b7232007-05-05 17:56:55 +000024syn cluster texEnvGroup add=@rnoweb
25syn cluster texFoldGroup add=@rnoweb
Bram Moolenaar77cdfd12016-03-12 12:57:59 +010026syn cluster texDocGroup add=@rnoweb
27syn cluster texPartGroup add=@rnoweb
28syn cluster texChapterGroup add=@rnoweb
29syn cluster texSectionGroup add=@rnoweb
30syn cluster texSubSectionGroup add=@rnoweb
31syn cluster texSubSubSectionGroup add=@rnoweb
32syn cluster texParaGroup add=@rnoweb
Bram Moolenaarc1e37902006-04-18 21:55:01 +000033
34" Highlighting of R code using an existing r.vim syntax file if available {{{1
35syn include @rnowebR syntax/r.vim
Bram Moolenaar11e3c5b2021-04-21 18:09:37 +020036syn region rnowebChunk matchgroup=rnowebDelimiter start="^\s*<<.*>>=" matchgroup=rnowebDelimiter end="^@" contains=@rnowebR,rnowebChunkReference,rnowebChunk fold keepend
37syn match rnowebChunkReference "^\s*<<.*>>$" contained
Bram Moolenaar77cdfd12016-03-12 12:57:59 +010038syn region rnowebSexpr matchgroup=Delimiter start="\\Sexpr{" matchgroup=Delimiter end="}" contains=@rnowebR contained
Bram Moolenaarc1e37902006-04-18 21:55:01 +000039
40" Sweave options command {{{1
41syn region rnowebSweaveopts matchgroup=Delimiter start="\\SweaveOpts{" matchgroup=Delimiter end="}"
42
43" rnoweb Cluster {{{1
44syn cluster rnoweb contains=rnowebChunk,rnowebChunkReference,rnowebDelimiter,rnowebSexpr,rnowebSweaveopts
45
46" Highlighting {{{1
47hi def link rnowebDelimiter Delimiter
48hi def link rnowebSweaveOpts Statement
Bram Moolenaar551dbcc2006-04-25 22:13:59 +000049hi def link rnowebChunkReference Delimiter
Bram Moolenaarc1e37902006-04-18 21:55:01 +000050
51let b:current_syntax = "rnoweb"
52" vim: foldmethod=marker: