home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / indent / xf86conf.vim < prev    next >
Encoding:
Text File  |  2010-08-14  |  679 b   |  38 lines

  1. " Vim indent file
  2. " Language:         XFree86 Configuration File
  3. " Maintainer:       Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision:  2006-12-20
  5.  
  6. if exists("b:did_indent")
  7.   finish
  8. endif
  9. let b:did_indent = 1
  10.  
  11. setlocal indentexpr=GetXF86ConfIndent()
  12. setlocal indentkeys=!^F,o,O,=End
  13. setlocal nosmartindent
  14.  
  15. if exists("*GetXF86ConfIndent")
  16.   finish
  17. endif
  18.  
  19. function 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 + &sw
  30.   endif
  31.  
  32.   if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
  33.     let ind = ind - &sw
  34.   endif
  35.  
  36.   return ind
  37. endfunction
  38.