Mercurial > hg > RemoteEditor > vim7
comparison runtime/indent/gitconfig.vim @ 39:c16898406ff2
synchorinize version 7.3.081
author | one@zeus.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 17 Dec 2010 17:43:06 +0900 |
parents | db46d51a3939 |
children | 67300faee616 |
comparison
equal
deleted
inserted
replaced
38:e06a1cd7230d | 39:c16898406ff2 |
---|---|
1 " Vim indent file | 1 " Vim indent file |
2 " Language: git config file | 2 " Language: git config file |
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.info> | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
4 " Last Change: 2008 Jun 04 | 4 " Last Change: 2010 May 21 |
5 | 5 |
6 if exists("b:did_indent") | 6 if exists("b:did_indent") |
7 finish | 7 finish |
8 endif | 8 endif |
9 let b:did_indent = 1 | 9 let b:did_indent = 1 |
16 if exists("*GetGitconfigIndent") | 16 if exists("*GetGitconfigIndent") |
17 finish | 17 finish |
18 endif | 18 endif |
19 | 19 |
20 function! GetGitconfigIndent() | 20 function! GetGitconfigIndent() |
21 let line = getline(prevnonblank(v:lnum-1)) | 21 let line = getline(prevnonblank(v:lnum-1)) |
22 let cline = getline(v:lnum) | 22 let cline = getline(v:lnum) |
23 if line =~ '\\\@<!\%(\\\\\)*\\$' | 23 if line =~ '\\\@<!\%(\\\\\)*\\$' |
24 " odd number of slashes, in a line continuation | 24 " odd number of slashes, in a line continuation |
25 return 2 * &sw | 25 return 2 * &sw |
26 elseif cline =~ '^\s*\[' | 26 elseif cline =~ '^\s*\[' |
27 return 0 | 27 return 0 |
28 elseif cline =~ '^\s*\a' | 28 elseif cline =~ '^\s*\a' |
29 return &sw | 29 return &sw |
30 elseif cline == '' && line =~ '^\[' | 30 elseif cline == '' && line =~ '^\[' |
31 return &sw | 31 return &sw |
32 else | 32 else |
33 return -1 | 33 return -1 |
34 endif | 34 endif |
35 endfunction | 35 endfunction |