Mercurial > vim
annotate runtime/indent/rnoweb.vim @ 34375:02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Commit: https://github.com/vim/vim/commit/f9ca139e3aa12dd03177ebba5eedcee4f0836f27
Author: Christian Brabandt <cb@256bit.org>
Date: Mon Feb 19 20:37:11 2024 +0100
runtime(misc): announce adoption of various runtime files
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 19 Feb 2024 21:00:10 +0100 |
parents | b2e8663e6dcc |
children |
rev | line source |
---|---|
6051 | 1 " Vim indent file |
2 " Language: Rnoweb | |
34375
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
32294
diff
changeset
|
3 " Maintainer: This runtime file is looking for a new maintainer. |
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
32294
diff
changeset
|
4 " Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> |
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
32294
diff
changeset
|
5 " Former Repository: https://github.com/jalvesaq/R-Vim-runtime |
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
32294
diff
changeset
|
6 " Last Change: 2024 Feb 27 07:17PM |
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
32294
diff
changeset
|
7 " 2024 Feb 19 by Vim Project (announce adoption) |
6051 | 8 |
9 | |
10 " Only load this indent file when no other was loaded. | |
11 if exists("b:did_indent") | |
12 finish | |
13 endif | |
14 runtime indent/tex.vim | |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
15 |
32294 | 16 function s:NoTeXIndent() |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
17 return indent(line(".")) |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
18 endfunction |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
19 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
20 if &indentexpr == "" || &indentexpr == "GetRnowebIndent()" |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
21 let s:TeXIndent = function("s:NoTeXIndent") |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
22 else |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
23 let s:TeXIndent = function(substitute(&indentexpr, "()", "", "")) |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
24 endif |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
25 |
14637 | 26 unlet! b:did_indent |
6051 | 27 runtime indent/r.vim |
28 let s:RIndent = function(substitute(&indentexpr, "()", "", "")) | |
29 let b:did_indent = 1 | |
30 | |
31 setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item | |
32 setlocal indentexpr=GetRnowebIndent() | |
33 | |
32061 | 34 let b:undo_indent = "setl inde< indk<" |
35 | |
6051 | 36 if exists("*GetRnowebIndent") |
37 finish | |
38 endif | |
39 | |
40 function GetRnowebIndent() | |
6840 | 41 let curline = getline(".") |
42 if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$' | |
6051 | 43 return 0 |
44 endif | |
45 if search("^<<", "bncW") > search("^@", "bncW") | |
46 return s:RIndent() | |
47 endif | |
48 return s:TeXIndent() | |
49 endfunction | |
50 | |
51 " vim: sw=2 |