Merge branch 'vim'
[MacVim.git] / runtime / indent / xf86conf.vim
blob4174a242240934871444294d7fa536201c450b61
1 " Vim indent file
2 " Language:         XFree86 Configuration File
3 " Maintainer:       Nikolai Weibull <now@bitwi.se>
4 " Latest Revision:  2006-12-20
6 if exists("b:did_indent")
7   finish
8 endif
9 let b:did_indent = 1
11 setlocal indentexpr=GetXF86ConfIndent()
12 setlocal indentkeys=!^F,o,O,=End
13 setlocal nosmartindent
15 if exists("*GetXF86ConfIndent")
16   finish
17 endif
19 function GetXF86ConfIndent()
20   let lnum = prevnonblank(v:lnum - 1)
22   if lnum == 0
23     return 0
24   endif
26   let ind = indent(lnum)
28   if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
29     let ind = ind + &sw
30   endif
32   if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
33     let ind = ind - &sw
34   endif
36   return ind
37 endfunction