2 " Language: git config file
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
4 " Last Change: 2013 May 30
6 if exists("b:did_indent")
12 setlocal indentexpr=GetGitconfigIndent()
13 setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F
15 let b:undo_indent = 'setl ai< inde< indk<'
17 " Only define the function once.
18 if exists("*GetGitconfigIndent")
22 function! GetGitconfigIndent()
23 let line = getline(prevnonblank(v:lnum-1))
24 let cline = getline(v:lnum)
25 if line =~ '\\\@<!\%(\\\\\)*\\$'
26 " odd number of slashes, in a line continuation
28 elseif cline =~ '^\s*\['
30 elseif cline =~ '^\s*\a'
32 elseif cline == '' && line =~ '^\['