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