xref: /vim-8.2.3635/runtime/indent/xf86conf.vim (revision 036986f1)
1" Vim indent file
2" Language:             XFree86 Configuration File
3" Previous Maintainer:  Nikolai Weibull <[email protected]>
4" Latest Revision:      2006-12-20
5
6if exists("b:did_indent")
7  finish
8endif
9let b:did_indent = 1
10
11setlocal indentexpr=GetXF86ConfIndent()
12setlocal indentkeys=!^F,o,O,=End
13setlocal nosmartindent
14
15if exists("*GetXF86ConfIndent")
16  finish
17endif
18
19function 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
28  if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
29    let ind = ind + shiftwidth()
30  endif
31
32  if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
33    let ind = ind - shiftwidth()
34  endif
35
36  return ind
37endfunction
38