2 " Language: git config file
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.info>
4 " Last Change: 2007 Dec 20
6 if exists("b:did_indent")
12 setlocal indentexpr=GetGitconfigIndent()
13 setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F
15 " Only define the function once.
16 if exists("*GetGitconfigIndent")
20 function! GetGitconfigIndent()
21 let line = getline(v:lnum-1)
22 let cline = getline(v:lnum)
23 if line =~ '[^\\]\@<=\%(\\\\\)*\\$'
24 " odd number of slashes, in a line continuation
26 elseif cline =~ '^\s*\['
28 elseif cline =~ '^\s*\a'
30 elseif cline == '' && line =~ '^\['
37 " vim:set sw=4 sts=4 noet: