7
|
1 " Vim indent file
|
375
|
2 " Language: Eterm configuration file
|
|
3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
|
4 " Latest Revision: 2005-06-29
|
7
|
5
|
|
6 if exists("b:did_indent")
|
|
7 finish
|
|
8 endif
|
|
9 let b:did_indent = 1
|
|
10
|
|
11 setlocal indentexpr=GetEtermIndent()
|
|
12 setlocal indentkeys=!^F,o,O,=end
|
|
13
|
|
14 if exists("*GetEtermIndent")
|
|
15 finish
|
|
16 endif
|
|
17
|
|
18 function GetEtermIndent()
|
|
19 let lnum = prevnonblank(v:lnum - 1)
|
|
20 if lnum == 0
|
|
21 return 0
|
|
22 endif
|
|
23
|
|
24 let ind = indent(lnum)
|
|
25
|
375
|
26 if getline(lnum) =~ '^\s*begin\>'
|
7
|
27 let ind = ind + &sw
|
|
28 endif
|
|
29
|
375
|
30 if getline(v:lnum) =~ '^\s*end\>'
|
7
|
31 let ind = ind - &sw
|
|
32 endif
|
|
33
|
|
34 return ind
|
|
35 endfunction
|