6051
|
1 " Vim indent file
|
|
2 " Language: Rnoweb
|
|
3 " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
|
|
4 " Last Change: Wed Jul 09, 2014 07:28PM
|
|
5
|
|
6
|
|
7 " Only load this indent file when no other was loaded.
|
|
8 if exists("b:did_indent")
|
|
9 finish
|
|
10 endif
|
|
11 runtime indent/tex.vim
|
|
12 let s:TeXIndent = function(substitute(&indentexpr, "()", "", ""))
|
|
13 unlet b:did_indent
|
|
14 runtime indent/r.vim
|
|
15 let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
|
|
16 let b:did_indent = 1
|
|
17
|
|
18 setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
|
|
19 setlocal indentexpr=GetRnowebIndent()
|
|
20
|
|
21 if exists("*GetRnowebIndent")
|
|
22 finish
|
|
23 endif
|
|
24
|
|
25 function GetRnowebIndent()
|
|
26 if getline(".") =~ "^<<.*>>=$"
|
|
27 return 0
|
|
28 endif
|
|
29 if search("^<<", "bncW") > search("^@", "bncW")
|
|
30 return s:RIndent()
|
|
31 endif
|
|
32 return s:TeXIndent()
|
|
33 endfunction
|
|
34
|
|
35 " vim: sw=2
|