0
0
mirror of https://github.com/vim/vim.git synced 2025-07-25 10:54:51 -04:00
vim/runtime/indent/eterm.vim

37 lines
668 B
VimL
Raw Normal View History

2004-06-13 20:20:40 +00:00
" Vim indent file
2017-03-05 17:04:09 +01:00
" Language: Eterm configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-12-20
2004-06-13 20:20:40 +00:00
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetEtermIndent()
setlocal indentkeys=!^F,o,O,=end
2007-05-10 17:52:45 +00:00
setlocal nosmartindent
2004-06-13 20:20:40 +00:00
if exists("*GetEtermIndent")
finish
endif
function GetEtermIndent()
let lnum = prevnonblank(v:lnum - 1)
if lnum == 0
return 0
endif
let ind = indent(lnum)
2005-06-29 22:40:58 +00:00
if getline(lnum) =~ '^\s*begin\>'
2017-03-16 17:41:02 +01:00
let ind = ind + shiftwidth()
2004-06-13 20:20:40 +00:00
endif
2005-06-29 22:40:58 +00:00
if getline(v:lnum) =~ '^\s*end\>'
2017-03-16 17:41:02 +01:00
let ind = ind - shiftwidth()
2004-06-13 20:20:40 +00:00
endif
return ind
endfunction