xref: /vim-8.2.3635/runtime/syntax/rnoweb.vim (revision 11e3c5ba)
1" Vim syntax file
2" Language:    R noweb Files
3" Maintainer:  Johannes Ranke <[email protected]>
4" Last Change: Thu Apr 05, 2018  11:06PM
5" Version:     0.9.1
6" Remarks:     - This file is inspired by the proposal of
7"                Fernando Henrique Ferraz Pereira da Rosa <[email protected]>
8"                http://www.ime.usp.br/~feferraz/en/sweavevim.html
9"
10
11if exists("b:current_syntax")
12  finish
13endif
14
15syn case match
16
17" Extension of Tex clusters {{{1
18runtime syntax/tex.vim
19unlet! b:current_syntax
20
21syn cluster texMatchGroup add=@rnoweb
22syn cluster texMathMatchGroup add=rnowebSexpr
23syn cluster texMathZoneGroup add=rnowebSexpr
24syn cluster texEnvGroup add=@rnoweb
25syn cluster texFoldGroup add=@rnoweb
26syn 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
33
34" Highlighting of R code using an existing r.vim syntax file if available {{{1
35syn include @rnowebR syntax/r.vim
36syn region rnowebChunk matchgroup=rnowebDelimiter start="^\s*<<.*>>=" matchgroup=rnowebDelimiter end="^@" contains=@rnowebR,rnowebChunkReference,rnowebChunk fold keepend
37syn match rnowebChunkReference "^\s*<<.*>>$" contained
38syn region rnowebSexpr matchgroup=Delimiter start="\\Sexpr{" matchgroup=Delimiter end="}" contains=@rnowebR contained
39
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
49hi def link rnowebChunkReference Delimiter
50
51let   b:current_syntax = "rnoweb"
52" vim: foldmethod=marker:
53