neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

xf86conf.vim (786B)


      1 " Vim indent file
      2 " Language:		XFree86 Configuration File
      3 " Maintainer:		Doug Kearns <dougkearns@gmail.com>
      4 " Previous Maintainer:	Nikolai Weibull <now@bitwi.se>
      5 " Last Change:		2022 April 25
      6 
      7 if exists("b:did_indent")
      8  finish
      9 endif
     10 let b:did_indent = 1
     11 
     12 setlocal indentexpr=GetXF86ConfIndent()
     13 setlocal indentkeys=!^F,o,O,=End
     14 setlocal nosmartindent
     15 
     16 let b:undo_indent = "setl inde< indk< si<"
     17 
     18 if exists("*GetXF86ConfIndent")
     19  finish
     20 endif
     21 
     22 function GetXF86ConfIndent()
     23  let lnum = prevnonblank(v:lnum - 1)
     24 
     25  if lnum == 0
     26    return 0
     27  endif
     28 
     29  let ind = indent(lnum)
     30 
     31  if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
     32    let ind = ind + shiftwidth()
     33  endif
     34 
     35  if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
     36    let ind = ind - shiftwidth()
     37  endif
     38 
     39  return ind
     40 endfunction