annotate runtime/indent/gitolite.vim @ 5167:e80ac6c158b8

Added tag v7-4a-009 for changeset 467efeee8f9e
author Bram Moolenaar <bram@vim.org>
date Tue, 09 Jul 2013 17:42:46 +0200
parents 91e53bcb7946
children 63b0b7b79b25
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim indent file
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: gitolite configuration
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " URL: https://github.com/tmatilai/gitolite.vim
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " Maintainer: Teemu Matilainen <teemu.matilainen@iki.fi>
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
5 " Last Change: 2011-12-24
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 if exists("b:did_indent")
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 finish
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 endif
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 let b:did_indent = 1
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 setlocal autoindent
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 setlocal indentexpr=GetGitoliteIndent()
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 setlocal indentkeys=o,O,*<Return>,!^F,=repo,\",=
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 " Only define the function once.
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 if exists("*GetGitoliteIndent")
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 finish
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 endif
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
21 let s:cpo_save = &cpo
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
22 set cpo&vim
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
23
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 function! GetGitoliteIndent()
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 let prevln = prevnonblank(v:lnum-1)
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 let pline = getline(prevln)
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 let cline = getline(v:lnum)
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 if cline =~ '^\s*\(C\|R\|RW\|RW+\|RWC\|RW+C\|RWD\|RW+D\|RWCD\|RW+CD\|-\)[ \t=]'
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 return &sw
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 elseif cline =~ '^\s*config\s'
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 return &sw
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 elseif pline =~ '^\s*repo\s' && cline =~ '^\s*\(#.*\)\?$'
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 return &sw
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 elseif cline =~ '^\s*#'
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 return indent(prevln)
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 elseif cline =~ '^\s*$'
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 return -1
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 else
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 return 0
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 endif
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 endfunction
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
43
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
44 let &cpo = s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
45 unlet s:cpo_save