1" Vim indent file 2" Language: Eterm configuration file 3" Maintainer: Doug Kearns <[email protected]> 4" Previous Maintainer: Nikolai Weibull <[email protected]> 5" Last Change: 24 Sep 2021 6 7if exists("b:did_indent") 8 finish 9endif 10let b:did_indent = 1 11 12setlocal indentexpr=GetEtermIndent() 13setlocal indentkeys=!^F,o,O,=end 14setlocal nosmartindent 15 16let b:undo_indent = "setl inde< indk< si<" 17 18if exists("*GetEtermIndent") 19 finish 20endif 21 22function GetEtermIndent() 23 let lnum = prevnonblank(v:lnum - 1) 24 if lnum == 0 25 return 0 26 endif 27 28 let ind = indent(lnum) 29 30 if getline(lnum) =~ '^\s*begin\>' 31 let ind = ind + shiftwidth() 32 endif 33 34 if getline(v:lnum) =~ '^\s*end\>' 35 let ind = ind - shiftwidth() 36 endif 37 38 return ind 39endfunction 40