Mercurial > vim
view runtime/indent/gitconfig.vim @ 4535:45f97c349537 v7.3.1015
updated for version 7.3.1015
Problem: New regexp engine: Matching composing characters is wrong.
Solution: Fix matching composing characters.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 25 May 2013 14:42:03 +0200 |
parents | 161d01cbb165 |
children | 2eb30f341e8d |
line wrap: on
line source
" Vim indent file " Language: git config file " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2012 April 7 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 let b:undo_indent = 'setl ai< inde< indk<' " Only define the function once. if exists("*GetGitconfigIndent") finish endif function! GetGitconfigIndent() let line = getline(prevnonblank(v:lnum-1)) let cline = getline(v:lnum) if line =~ '\\\@<!\%(\\\\\)*\\$' " odd number of slashes, in a line continuation return 2 * &sw elseif cline =~ '^\s*\[' return 0 elseif cline =~ '^\s*\a' return &sw elseif cline == '' && line =~ '^\[' return &sw else return -1 endif endfunction