blob: 7d93c967eee512d667aa9f538432ea9610f70bb5 [file] [log] [blame]
Bram Moolenaar15146672011-10-20 22:22:38 +02001" Vim syntax file
2" Language: gitolite configuration
3" URL: https://github.com/tmatilai/gitolite.vim
4" Maintainer: Teemu Matilainen <teemu.matilainen@iki.fi>
5" Last Change: 2011-10-05
6
7if exists("b:current_syntax")
8 finish
9endif
10
11" Comment
12syn match gitoliteComment "\(^\|\s\)#.*" contains=gitoliteTodo
13syn keyword gitoliteTodo TODO FIXME XXX NOT contained
14
15" Groups, users and repos
16syn match gitoliteGroupDef "\(^\s*\)\@<=@[^=]\{-1,}\(\s*=\)\@=" contains=gitoliteSpaceError,gitoliteUserError nextgroup=gitoliteGroupDefSep
17syn match gitoliteGroupDefSep "\s*=" contained nextgroup=gitoliteRepoLine
18syn match gitoliteRepoDef "^\s*repo\s" nextgroup=gitoliteRepoLine
19
20syn match gitoliteRepoLine ".*" contained transparent contains=gitoliteGroup,gitoliteWildRepo,gitoliteCreator,gitoliteExtCmdHelper,gitoliteRepoError,gitoliteComment
21syn match gitoliteUserLine ".*" contained transparent contains=gitoliteGroup,gitolitePreProc,gitoliteUserError,gitoliteComment
22
23syn match gitoliteWildRepo "[ \t=]\@<=[^ \t]*[\\^$|()[\]*?{}][^ \t]*" contained contains=gitoliteCreator,gitoliteRepoError
24syn match gitoliteGroup "[ \t=]\@<=@[^ \t]\+" contained contains=gitoliteUserError
25
26syn keyword gitoliteCreator CREATER CREATOR contained
27syn keyword gitolitePreProc CREATER CREATOR READERS WRITERS contained
28
29syn match gitoliteExtCmdHelper "[ \t=]\@<=EXTCMD/" contained nextgroup=gitoliteExtCmd
30syn match gitoliteExtCmd "rsync\(\s\|$\)" contained
31
32" Illegal characters
33syn match gitoliteRepoError "[^ \t0-9a-zA-Z._@+/\\^$|()[\]*?{}-]\+" contained
34syn match gitoliteUserError "[^ \t0-9a-zA-Z._@+-]\+" contained
35syn match gitoliteSpaceError "\s\+" contained
36
37" Permission
38syn match gitoliteKeyword "^\s*\(C\|R\|RW\|RW+\|RWC\|RW+C\|RWD\|RW+D\|RWCD\|RW+CD\)[ \t=]\@=" nextgroup=gitoliteRefex
39syn match gitoliteKeyword "^\s*-[ \t=]\@=" nextgroup=gitoliteDenyRefex
40syn match gitoliteRefex "[^=]*="he=e-1 contained contains=gitoliteSpecialRefex,gitoliteGroup nextgroup=gitoliteUserLine
41syn match gitoliteDenyRefex "[^=]*="he=e-1 contained contains=gitoliteSpecialRefex,gitoliteGroup nextgroup=gitoliteDenyUsers
42syn match gitoliteSpecialRefex "\sNAME/"he=e-1 contained
43syn match gitoliteSpecialRefex "/USER/"hs=s+1,he=e-1 contained
44syn match gitoliteDenyUsers ".*" contained contains=gitoliteUserError,gitoliteComment
45
46" Configuration
47syn match gitoliteKeyword "^\s*config\s\+" nextgroup=gitoliteConfVariable
48syn match gitoliteConfVariable "[^=]*" contained
49
50" Include
51syn match gitoliteInclude "^\s*\(include\|subconf\)\s"
52
53" String
54syn region gitoliteString start=+"+ end=+"+ oneline
55
56" Define the default highlighting
57hi def link gitoliteComment Comment
58hi def link gitoliteTodo Todo
59hi def link gitoliteGroupDef gitoliteGroup
60hi def link gitoliteGroup Identifier
61hi def link gitoliteWildRepo Special
62hi def link gitoliteRepoError gitoliteError
63hi def link gitoliteUserError gitoliteError
64hi def link gitoliteSpaceError gitoliteError
65hi def link gitoliteError Error
66hi def link gitoliteCreator gitolitePreProc
67hi def link gitolitePreProc PreProc
68hi def link gitoliteExtCmdHelper PreProc
69hi def link gitoliteExtCmd Special
70hi def link gitoliteRepoDef Type
71hi def link gitoliteKeyword Keyword
72hi def link gitoliteRefex String
73hi def link gitoliteDenyRefex gitoliteRefex
74hi def link gitoliteSpecialRefex PreProc
75hi def link gitoliteDenyUsers WarningMsg
76hi def link gitoliteConfVariable Identifier
77hi def link gitoliteInclude Include
78hi def link gitoliteString String
79
80let b:current_syntax = "gitolite"