2004-06-13 20:20:40 +00:00
|
|
|
" Vim indent file
|
2007-05-10 19:06:20 +00:00
|
|
|
" Language: XFree86 Configuration File
|
2006-04-21 22:12:41 +00:00
|
|
|
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
2007-05-10 19:06:20 +00:00
|
|
|
" Latest Revision: 2006-12-20
|
2004-06-13 20:20:40 +00:00
|
|
|
|
|
|
|
if exists("b:did_indent")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let b:did_indent = 1
|
|
|
|
|
|
|
|
setlocal indentexpr=GetXF86ConfIndent()
|
|
|
|
setlocal indentkeys=!^F,o,O,=End
|
2007-05-10 19:06:20 +00:00
|
|
|
setlocal nosmartindent
|
2004-06-13 20:20:40 +00:00
|
|
|
|
|
|
|
if exists("*GetXF86ConfIndent")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
function GetXF86ConfIndent()
|
|
|
|
let lnum = prevnonblank(v:lnum - 1)
|
|
|
|
|
|
|
|
if lnum == 0
|
|
|
|
return 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
let ind = indent(lnum)
|
|
|
|
|
2005-06-29 22:40:58 +00:00
|
|
|
if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
|
2004-06-13 20:20:40 +00:00
|
|
|
let ind = ind + &sw
|
2005-06-29 22:40:58 +00:00
|
|
|
endif
|
|
|
|
|
2007-05-10 19:06:20 +00:00
|
|
|
if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
|
2004-06-13 20:20:40 +00:00
|
|
|
let ind = ind - &sw
|
|
|
|
endif
|
|
|
|
|
|
|
|
return ind
|
|
|
|
endfunction
|