| 
									
										
										
										
											2014-07-10 22:01:47 +02:00
										 |  |  | " Vim indent file | 
					
						
							|  |  |  | " Language:	Rnoweb | 
					
						
							| 
									
										
										
										
											2024-02-19 20:37:11 +01:00
										 |  |  | " 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 | 
					
						
							| 
									
										
										
										
											2016-08-26 19:52:37 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-22 22:40:14 +01:00
										 |  |  | function s:NoTeXIndent() | 
					
						
							| 
									
										
										
										
											2016-08-26 19:52:37 +02:00
										 |  |  |   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 |