blob: 7d42395b5c862d02288b74af2b179ac5e341a53d [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 Moolenaar5c736222010-01-06 20:54:52 +01004" Last Change: 2009 May 05
5" Version: 0.9
6" SVN: $Id: rnoweb.vim 84 2009-05-03 19:52:47Z ranke $
Bram Moolenaarc1e37902006-04-18 21:55:01 +00007" Remarks: - This file is inspired by the proposal of
8" Fernando Henrique Ferraz Pereira da Rosa <feferraz@ime.usp.br>
9" http://www.ime.usp.br/~feferraz/en/sweavevim.html
Bram Moolenaarc1e37902006-04-18 21:55:01 +000010"
11
12" Version Clears: {{{1
13" For version 5.x: Clear all syntax items
14" For version 6.x and 7.x: Quit when a syntax file was already loaded
15if version < 600
16 syntax clear
17elseif exists("b:current_syntax")
18 finish
19endif
20
21syn case match
22
Bram Moolenaar313b7232007-05-05 17:56:55 +000023" Extension of Tex clusters {{{1
Bram Moolenaarc1e37902006-04-18 21:55:01 +000024runtime syntax/tex.vim
25unlet b:current_syntax
26
Bram Moolenaar313b7232007-05-05 17:56:55 +000027syn cluster texMatchGroup add=@rnoweb
Bram Moolenaar5c736222010-01-06 20:54:52 +010028syn cluster texMathMatchGroup add=rnowebSexpr
Bram Moolenaar313b7232007-05-05 17:56:55 +000029syn cluster texEnvGroup add=@rnoweb
30syn cluster texFoldGroup add=@rnoweb
31syn cluster texDocGroup add=@rnoweb
32syn cluster texPartGroup add=@rnoweb
33syn cluster texChapterGroup add=@rnoweb
34syn cluster texSectionGroup add=@rnoweb
35syn cluster texSubSectionGroup add=@rnoweb
36syn cluster texSubSubSectionGroup add=@rnoweb
37syn cluster texParaGroup add=@rnoweb
Bram Moolenaarc1e37902006-04-18 21:55:01 +000038
39" Highlighting of R code using an existing r.vim syntax file if available {{{1
40syn include @rnowebR syntax/r.vim
Bram Moolenaar313b7232007-05-05 17:56:55 +000041syn region rnowebChunk matchgroup=rnowebDelimiter start="^<<.*>>=" matchgroup=rnowebDelimiter end="^@" contains=@rnowebR,rnowebChunkReference,rnowebChunk fold keepend
Bram Moolenaarc1e37902006-04-18 21:55:01 +000042syn match rnowebChunkReference "^<<.*>>$" contained
43syn region rnowebSexpr matchgroup=Delimiter start="\\Sexpr{" matchgroup=Delimiter end="}" contains=@rnowebR
44
45" Sweave options command {{{1
46syn region rnowebSweaveopts matchgroup=Delimiter start="\\SweaveOpts{" matchgroup=Delimiter end="}"
47
48" rnoweb Cluster {{{1
49syn cluster rnoweb contains=rnowebChunk,rnowebChunkReference,rnowebDelimiter,rnowebSexpr,rnowebSweaveopts
50
51" Highlighting {{{1
52hi def link rnowebDelimiter Delimiter
53hi def link rnowebSweaveOpts Statement
Bram Moolenaar551dbcc2006-04-25 22:13:59 +000054hi def link rnowebChunkReference Delimiter
Bram Moolenaarc1e37902006-04-18 21:55:01 +000055
56let b:current_syntax = "rnoweb"
57" vim: foldmethod=marker: