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