Mercurial > vim
annotate runtime/indent/rnoweb.vim @ 9402:165d9b2513e9
Added tag v7.4.1982 for changeset 160cb082819e3ee4494d219dc7e903bb7e657357
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Jul 2016 19:30:06 +0200 |
parents | da01d5da2cfa |
children | 03fa8a51e9dc |
rev | line source |
---|---|
6051 | 1 " Vim indent file |
2 " Language: Rnoweb | |
3 " Author: Jakson Alves de Aquino <jalvesaq@gmail.com> | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
6840
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:
6840
diff
changeset
|
5 " Last Change: Tue Apr 07, 2015 04:38PM |
6051 | 6 |
7 | |
8 " Only load this indent file when no other was loaded. | |
9 if exists("b:did_indent") | |
10 finish | |
11 endif | |
12 runtime indent/tex.vim | |
13 let s:TeXIndent = function(substitute(&indentexpr, "()", "", "")) | |
14 unlet b:did_indent | |
15 runtime indent/r.vim | |
16 let s:RIndent = function(substitute(&indentexpr, "()", "", "")) | |
17 let b:did_indent = 1 | |
18 | |
19 setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item | |
20 setlocal indentexpr=GetRnowebIndent() | |
21 | |
22 if exists("*GetRnowebIndent") | |
23 finish | |
24 endif | |
25 | |
26 function GetRnowebIndent() | |
6840 | 27 let curline = getline(".") |
28 if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$' | |
6051 | 29 return 0 |
30 endif | |
31 if search("^<<", "bncW") > search("^@", "bncW") | |
32 return s:RIndent() | |
33 endif | |
34 return s:TeXIndent() | |
35 endfunction | |
36 | |
37 " vim: sw=2 |