blob: d0cad3d8d9c9af4e23608807f1ae728b113b635b [file] [log] [blame]
Bram Moolenaardb6ea062014-07-10 22:01:47 +02001" Vim indent file
2" Language: Rnoweb
3" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
Bram Moolenaar541f92d2015-06-19 13:27:23 +02004" Last Change: Sun Mar 22, 2015 09:28AM
Bram Moolenaardb6ea062014-07-10 22:01:47 +02005
6
7" Only load this indent file when no other was loaded.
8if exists("b:did_indent")
9 finish
10endif
11runtime indent/tex.vim
12let s:TeXIndent = function(substitute(&indentexpr, "()", "", ""))
13unlet b:did_indent
14runtime indent/r.vim
15let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
16let b:did_indent = 1
17
18setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
19setlocal indentexpr=GetRnowebIndent()
20
21if exists("*GetRnowebIndent")
22 finish
23endif
24
25function GetRnowebIndent()
Bram Moolenaar541f92d2015-06-19 13:27:23 +020026 let curline = getline(".")
27 if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$'
Bram Moolenaardb6ea062014-07-10 22:01:47 +020028 return 0
29 endif
30 if search("^<<", "bncW") > search("^@", "bncW")
31 return s:RIndent()
32 endif
33 return s:TeXIndent()
34endfunction
35
36" vim: sw=2