7
|
1 " Vim indent file
|
28620
|
2 " Language: XFree86 Configuration File
|
|
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
|
5 " Last Change: 2022 April 25
|
7
|
6
|
|
7 if exists("b:did_indent")
|
|
8 finish
|
|
9 endif
|
|
10 let b:did_indent = 1
|
|
11
|
|
12 setlocal indentexpr=GetXF86ConfIndent()
|
|
13 setlocal indentkeys=!^F,o,O,=End
|
1224
|
14 setlocal nosmartindent
|
7
|
15
|
28620
|
16 let b:undo_indent = "setl inde< indk< si<"
|
|
17
|
7
|
18 if exists("*GetXF86ConfIndent")
|
|
19 finish
|
|
20 endif
|
|
21
|
|
22 function GetXF86ConfIndent()
|
|
23 let lnum = prevnonblank(v:lnum - 1)
|
|
24
|
|
25 if lnum == 0
|
|
26 return 0
|
|
27 endif
|
|
28
|
|
29 let ind = indent(lnum)
|
|
30
|
375
|
31 if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
|
11160
|
32 let ind = ind + shiftwidth()
|
375
|
33 endif
|
|
34
|
1224
|
35 if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
|
11160
|
36 let ind = ind - shiftwidth()
|
7
|
37 endif
|
|
38
|
|
39 return ind
|
|
40 endfunction
|