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