annotate runtime/syntax/rrst.vim @ 7586:9fc996244059 v7.4.1093

commit https://github.com/vim/vim/commit/24c4d539eed33e8073f8f9fe2bee497bbba935a4 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 15 15:37:20 2016 +0100 patch 7.4.1093 Problem: Typo in test goes unnoticed. Solution: Fix the typo. Give error for wrong arguments to cursor(). (partly by Hirohito Higashi) Add a test for cursor().
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jan 2016 15:45:06 +0100
parents 0efec12f52ac
children da01d5da2cfa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " reStructured Text with R statements
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: reST with R code chunks
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " Last Change: Wed Jul 09, 2014 10:29PM
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 "
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 " CONFIGURATION:
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 " To highlight chunk headers as R code, put in your vimrc:
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 " let rrst_syn_hl_chunk = 1
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 " for portability
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 if version < 600
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 syntax clear
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 elseif exists("b:current_syntax")
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 finish
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 endif
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 " load all of the rst info
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 runtime syntax/rst.vim
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 unlet b:current_syntax
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 " load all of the r syntax highlighting rules into @R
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 syntax include @R syntax/r.vim
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 setlocal iskeyword=@,48-57,_,.
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 " highlight R chunks
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 if exists("g:rrst_syn_hl_chunk")
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 " highlight R code inside chunk header
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 syntax match rrstChunkDelim "^\.\. {r" contained
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 syntax match rrstChunkDelim "}$" contained
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 else
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 syntax match rrstChunkDelim "^\.\. {r .*}$" contained
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 endif
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 syntax match rrstChunkDelim "^\.\. \.\.$" contained
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 syntax region rrstChunk start="^\.\. {r.*}$" end="^\.\. \.\.$" contains=@R,rrstChunkDelim keepend transparent fold
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 " also highlight in-line R code
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 syntax match rrstInlineDelim "`" contained
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 syntax match rrstInlineDelim ":r:" contained
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 syntax region rrstInline start=":r: *`" skip=/\\\\\|\\`/ end="`" contains=@R,rrstInlineDelim keepend
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 hi def link rrstChunkDelim Special
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 hi def link rrstInlineDelim Special
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 let b:current_syntax = "rrst"
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 " vim: ts=8 sw=2