annotate runtime/indent/gitconfig.vim @ 8857:df68de6b6f1c v7.4.1716

commit https://github.com/vim/vim/commit/baec5c1768098f9dd867b465aaabfdfb294f10c2 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 6 23:06:23 2016 +0200 patch 7.4.1716 Problem: 'autochdir' doesn't work for the first file. (Rob Hoelz) Solution: Call DO_AUTOCHDIR after startup. (Christian Brabandt, closes https://github.com/vim/vim/issues/704)
author Christian Brabandt <cb@256bit.org>
date Wed, 06 Apr 2016 23:15:04 +0200
parents 2eb30f341e8d
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
1 " Vim indent file
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
2 " Language: git config file
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3465
diff changeset
4 " Last Change: 2013 May 30
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
5
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
6 if exists("b:did_indent")
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
7 finish
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
8 endif
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
9 let b:did_indent = 1
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
10
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
11 setlocal autoindent
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
12 setlocal indentexpr=GetGitconfigIndent()
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
13 setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
14
3465
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
15 let b:undo_indent = 'setl ai< inde< indk<'
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
16
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
17 " Only define the function once.
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
18 if exists("*GetGitconfigIndent")
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
19 finish
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
20 endif
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
21
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
22 function! GetGitconfigIndent()
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
23 let line = getline(prevnonblank(v:lnum-1))
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
24 let cline = getline(v:lnum)
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
25 if line =~ '\\\@<!\%(\\\\\)*\\$'
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
26 " odd number of slashes, in a line continuation
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
27 return 2 * &sw
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
28 elseif cline =~ '^\s*\['
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
29 return 0
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
30 elseif cline =~ '^\s*\a'
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
31 return &sw
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
32 elseif cline == '' && line =~ '^\['
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
33 return &sw
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
34 else
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
35 return -1
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
36 endif
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
37 endfunction