7
|
1 " Vim indent file
|
1224
|
2 " Language: XFree86 Configuration File
|
839
|
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
|
1224
|
4 " Latest Revision: 2006-12-20
|
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
|
1224
|
13 setlocal nosmartindent
|
7
|
14
|
|
15 if exists("*GetXF86ConfIndent")
|
|
16 finish
|
|
17 endif
|
|
18
|
|
19 function GetXF86ConfIndent()
|
|
20 let lnum = prevnonblank(v:lnum - 1)
|
|
21
|
|
22 if lnum == 0
|
|
23 return 0
|
|
24 endif
|
|
25
|
|
26 let ind = indent(lnum)
|
|
27
|
375
|
28 if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
|
7
|
29 let ind = ind + &sw
|
375
|
30 endif
|
|
31
|
1224
|
32 if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
|
7
|
33 let ind = ind - &sw
|
|
34 endif
|
|
35
|
|
36 return ind
|
|
37 endfunction
|