2 " Language: git config file
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
5 if exists("b:did_indent")
11 setlocal indentexpr=GetGitconfigIndent()
12 setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F
14 let b:undo_indent = 'setl ai< inde< indk<'
16 " Only define the function once.
17 if exists("*GetGitconfigIndent")
21 function! GetGitconfigIndent()
22 let line = getline(prevnonblank(v:lnum-1))
23 let cline = getline(v:lnum)
24 if line =~ '\\\@<!\%(\\\\\)*\\$'
25 " odd number of slashes, in a line continuation
27 elseif cline =~ '^\s*\['
29 elseif cline =~ '^\s*\a'
31 elseif cline == '' && line =~ '^\['