6051
|
1 " Vim indent file
|
|
2 " Language: Rnoweb
|
|
3 " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
|
6840
|
4 " Last Change: Sun Mar 22, 2015 09:28AM
|
6051
|
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()
|
6840
|
26 let curline = getline(".")
|
|
27 if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$'
|
6051
|
28 return 0
|
|
29 endif
|
|
30 if search("^<<", "bncW") > search("^@", "bncW")
|
|
31 return s:RIndent()
|
|
32 endif
|
|
33 return s:TeXIndent()
|
|
34 endfunction
|
|
35
|
|
36 " vim: sw=2
|