1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-22 01:35:11 +01:00
vim/runtime/indent/rnoweb.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.2 KiB
VimL
Raw Permalink Normal View History

2014-07-10 22:01:47 +02:00
" Vim indent file
" Language: Rnoweb
" Maintainer: This runtime file is looking for a new maintainer.
" Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Former Repository: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: 2024 Feb 27 07:17PM
" 2024 Feb 19 by Vim Project (announce adoption)
2014-07-10 22:01:47 +02:00
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
runtime indent/tex.vim
2023-04-22 22:40:14 +01:00
function s:NoTeXIndent()
return indent(line("."))
endfunction
if &indentexpr == "" || &indentexpr == "GetRnowebIndent()"
let s:TeXIndent = function("s:NoTeXIndent")
else
let s:TeXIndent = function(substitute(&indentexpr, "()", "", ""))
endif
2018-08-28 22:58:02 +02:00
unlet! b:did_indent
2014-07-10 22:01:47 +02:00
runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1
setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
setlocal indentexpr=GetRnowebIndent()
2023-02-27 15:49:53 +00:00
let b:undo_indent = "setl inde< indk<"
2014-07-10 22:01:47 +02:00
if exists("*GetRnowebIndent")
finish
endif
function GetRnowebIndent()
2015-06-19 13:27:23 +02:00
let curline = getline(".")
if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$'
2014-07-10 22:01:47 +02:00
return 0
endif
if search("^<<", "bncW") > search("^@", "bncW")
return s:RIndent()
endif
return s:TeXIndent()
endfunction
" vim: sw=2