Mercurial > vim
annotate runtime/syntax/rrst.vim @ 9424:fd4e6d944f4a v7.4.1993
commit https://github.com/vim/vim/commit/6bb450145e96d7b182769fd9502a267da72667ec
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 7 15:11:19 2016 +0200
patch 7.4.1993
Problem: Not all TRUE and FALSE arguments are tested.
Solution: Add a few more tests.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 07 Jul 2016 15:15:06 +0200 |
parents | da01d5da2cfa |
children | 03fa8a51e9dc |
rev | line source |
---|---|
6051 | 1 " reStructured Text with R statements |
2 " Language: reST with R code chunks | |
3 " Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
6051
diff
changeset
|
4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime |
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
6051
diff
changeset
|
5 " Last Change: Sat Feb 06, 2016 06:45AM |
6051 | 6 " |
7 " CONFIGURATION: | |
8 " To highlight chunk headers as R code, put in your vimrc: | |
9 " let rrst_syn_hl_chunk = 1 | |
10 | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
6051
diff
changeset
|
11 if exists("b:current_syntax") |
6051 | 12 finish |
13 endif | |
14 | |
15 " load all of the rst info | |
16 runtime syntax/rst.vim | |
17 unlet b:current_syntax | |
18 | |
19 " load all of the r syntax highlighting rules into @R | |
20 syntax include @R syntax/r.vim | |
21 | |
22 setlocal iskeyword=@,48-57,_,. | |
23 | |
24 " highlight R chunks | |
25 if exists("g:rrst_syn_hl_chunk") | |
26 " highlight R code inside chunk header | |
27 syntax match rrstChunkDelim "^\.\. {r" contained | |
28 syntax match rrstChunkDelim "}$" contained | |
29 else | |
30 syntax match rrstChunkDelim "^\.\. {r .*}$" contained | |
31 endif | |
32 syntax match rrstChunkDelim "^\.\. \.\.$" contained | |
33 syntax region rrstChunk start="^\.\. {r.*}$" end="^\.\. \.\.$" contains=@R,rrstChunkDelim keepend transparent fold | |
34 | |
35 " also highlight in-line R code | |
36 syntax match rrstInlineDelim "`" contained | |
37 syntax match rrstInlineDelim ":r:" contained | |
38 syntax region rrstInline start=":r: *`" skip=/\\\\\|\\`/ end="`" contains=@R,rrstInlineDelim keepend | |
39 | |
40 hi def link rrstChunkDelim Special | |
41 hi def link rrstInlineDelim Special | |
42 | |
43 let b:current_syntax = "rrst" | |
44 | |
45 " vim: ts=8 sw=2 |