836
|
1 " Vim syntax file
|
|
2 " Language: R noweb Files
|
|
3 " Maintainer: Johannes Ranke <jranke@uni-bremen.de>
|
1122
|
4 " Last Change: 2007 Mär 30
|
|
5 " Version: 0.8
|
836
|
6 " SVN: $Id$
|
|
7 " 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
|
|
10 "
|
|
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
|
|
15 if version < 600
|
|
16 syntax clear
|
|
17 elseif exists("b:current_syntax")
|
|
18 finish
|
|
19 endif
|
|
20
|
|
21 syn case match
|
|
22
|
1122
|
23 " Extension of Tex clusters {{{1
|
836
|
24 runtime syntax/tex.vim
|
|
25 unlet b:current_syntax
|
|
26
|
1122
|
27 syn cluster texMatchGroup add=@rnoweb
|
|
28 syn cluster texEnvGroup add=@rnoweb
|
|
29 syn cluster texFoldGroup add=@rnoweb
|
|
30 syn cluster texDocGroup add=@rnoweb
|
|
31 syn cluster texPartGroup add=@rnoweb
|
|
32 syn cluster texChapterGroup add=@rnoweb
|
|
33 syn cluster texSectionGroup add=@rnoweb
|
|
34 syn cluster texSubSectionGroup add=@rnoweb
|
|
35 syn cluster texSubSubSectionGroup add=@rnoweb
|
|
36 syn cluster texParaGroup add=@rnoweb
|
836
|
37
|
|
38 " Highlighting of R code using an existing r.vim syntax file if available {{{1
|
|
39 syn include @rnowebR syntax/r.vim
|
1122
|
40 syn region rnowebChunk matchgroup=rnowebDelimiter start="^<<.*>>=" matchgroup=rnowebDelimiter end="^@" contains=@rnowebR,rnowebChunkReference,rnowebChunk fold keepend
|
836
|
41 syn match rnowebChunkReference "^<<.*>>$" contained
|
|
42 syn region rnowebSexpr matchgroup=Delimiter start="\\Sexpr{" matchgroup=Delimiter end="}" contains=@rnowebR
|
|
43
|
|
44 " Sweave options command {{{1
|
|
45 syn region rnowebSweaveopts matchgroup=Delimiter start="\\SweaveOpts{" matchgroup=Delimiter end="}"
|
|
46
|
|
47 " rnoweb Cluster {{{1
|
|
48 syn cluster rnoweb contains=rnowebChunk,rnowebChunkReference,rnowebDelimiter,rnowebSexpr,rnowebSweaveopts
|
|
49
|
|
50 " Highlighting {{{1
|
|
51 hi def link rnowebDelimiter Delimiter
|
|
52 hi def link rnowebSweaveOpts Statement
|
843
|
53 hi def link rnowebChunkReference Delimiter
|
836
|
54
|
|
55 let b:current_syntax = "rnoweb"
|
|
56 " vim: foldmethod=marker:
|