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