1" Vim indent file 2" Language: Rnoweb 3" Author: Jakson Alves de Aquino <[email protected]> 4" Last Change: Sun Mar 22, 2015 09:28AM 5 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() 26 let curline = getline(".") 27 if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$' 28 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 37