File: gitconfig.vim

package info (click to toggle)
vim 1%3A7.1.314-3%2Blenny2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 39,856 kB
  • ctags: 25,430
  • sloc: ansic: 279,681; cpp: 3,229; makefile: 2,958; perl: 1,232; sh: 857; awk: 715; xml: 507; cs: 458; asm: 114; python: 28; csh: 6
file content (35 lines) | stat: -rw-r--r-- 783 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
" Vim indent file
" Language:	git config file
" Maintainer:	Tim Pope <vimNOSPAM@tpope.info>
" Last Change:	2007 Dec 16

if exists("b:did_indent")
  finish
endif
let b:did_indent = 1

setlocal autoindent
setlocal indentexpr=GetGitconfigIndent()
setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F

" Only define the function once.
if exists("*GetGitconfigIndent")
  finish
endif

function! GetGitconfigIndent()
    let line  = getline(v:lnum-1)
    let cline = getline(v:lnum)
    if line =~ '[^\\]\@<=\%(\\\\\)*\\$'
	" odd number of slashes, in a line continuation
	return -1
    elseif cline =~ '^\s*\['
        return 0
    elseif cline =~ '^\s*\a'
        return &sw
    elseif cline == ''       && line =~ '^\['
        return &sw
    else
        return -1
    endif
endfunction