annotate runtime/indent/eterm.vim @ 456:c4d200412ae9 v7.0121

updated for version 7.0121
author vimboss
date Mon, 01 Aug 2005 07:19:10 +0000
parents f14cbd913415
children 1f3b1021f002
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim indent file
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
2 " Language: Eterm configuration file
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
4 " Latest Revision: 2005-06-29
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 if exists("b:did_indent")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 let b:did_indent = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 setlocal indentexpr=GetEtermIndent()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 setlocal indentkeys=!^F,o,O,=end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 if exists("*GetEtermIndent")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 function GetEtermIndent()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 let lnum = prevnonblank(v:lnum - 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 if lnum == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 return 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 let ind = indent(lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
26 if getline(lnum) =~ '^\s*begin\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 let ind = ind + &sw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
30 if getline(v:lnum) =~ '^\s*end\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 let ind = ind - &sw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 return ind
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 endfunction