blob: f9db1ba965f02fbbde7f3aa3991557cca68fe7e4 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim indent file
2" Language: XFree86 Configuration File
3" Maintainer: Nikolai Weibull <source@pcppopper.org>
4" URL: http://www.pcppopper.org/vim/indent/pcp/xf86conf/
5" Latest Revision: 2004-04-25
6" arch-tag: 8a42f7b6-5088-49cf-b15b-07696a91c015
7
8" Only load this indent file when no other was loaded.
9if exists("b:did_indent")
10 finish
11endif
12
13let b:did_indent = 1
14
15setlocal indentexpr=GetXF86ConfIndent()
16setlocal indentkeys=!^F,o,O,=End
17
18" Only define the function once.
19if exists("*GetXF86ConfIndent")
20 finish
21endif
22
23function GetXF86ConfIndent()
24 let lnum = prevnonblank(v:lnum - 1)
25
26 if lnum == 0
27 return 0
28 endif
29
30 let ind = indent(lnum)
31 let line = getline(lnum)
32
33 if line =~? '^\s*\(Sub\)\=Section'
34 let ind = ind + &sw
35 elseif getline(v:lnum) =~? '^\s*End'
36 let ind = ind - &sw
37 endif
38
39 return ind
40endfunction
41
42" vim: set sts=2 sw=2: