Mercurial > vim
annotate runtime/indent/rnoweb.vim @ 10796:5a722d39df70
Added tag v8.0.0287 for changeset 8afee415119d7672493c8298ce8a536087924ddf
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 01 Feb 2017 20:30:04 +0100 |
parents | 03fa8a51e9dc |
children | 0ecb909e3249 |
rev | line source |
---|---|
6051 | 1 " Vim indent file |
2 " Language: Rnoweb | |
3 " Author: Jakson Alves de Aquino <jalvesaq@gmail.com> | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
6840
diff
changeset
|
4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
5 " Last Change: Fri Apr 15, 2016 10:58PM |
6051 | 6 |
7 | |
8 " Only load this indent file when no other was loaded. | |
9 if exists("b:did_indent") | |
10 finish | |
11 endif | |
12 runtime indent/tex.vim | |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
13 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
14 function! s:NoTeXIndent() |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
15 return indent(line(".")) |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
16 endfunction |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
17 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
18 if &indentexpr == "" || &indentexpr == "GetRnowebIndent()" |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
19 let s:TeXIndent = function("s:NoTeXIndent") |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
20 else |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
21 let s:TeXIndent = function(substitute(&indentexpr, "()", "", "")) |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
22 endif |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8497
diff
changeset
|
23 |
6051 | 24 unlet b:did_indent |
25 runtime indent/r.vim | |
26 let s:RIndent = function(substitute(&indentexpr, "()", "", "")) | |
27 let b:did_indent = 1 | |
28 | |
29 setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item | |
30 setlocal indentexpr=GetRnowebIndent() | |
31 | |
32 if exists("*GetRnowebIndent") | |
33 finish | |
34 endif | |
35 | |
36 function GetRnowebIndent() | |
6840 | 37 let curline = getline(".") |
38 if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$' | |
6051 | 39 return 0 |
40 endif | |
41 if search("^<<", "bncW") > search("^@", "bncW") | |
42 return s:RIndent() | |
43 endif | |
44 return s:TeXIndent() | |
45 endfunction | |
46 | |
47 " vim: sw=2 |