Debian Codegraph @

doc/extras/vim/syntax/groupsconf.vim

raw symbols SCIP
1
2 " Vim syntax file for ClusterShell groups.conf
3
4 " For version 5.x: Clear all syntax items
5 " For version 6.x: Quit when a syntax file was already loaded
6 if version < 600
7 syntax clear
8 elseif exists("b:current_syntax")
9 finish
10 endif
11
12 " shut case off
13 syn case ignore
14
15 " Main/default
16 syn match groupsDefaultValue "\(:\|=\)\s*\w\+$"ms=s+1 contained
17 syn match groupsColonValue "\(:\|=\).*" contained contains=groupsDefaultValue
18 syn match groupsDefaultKey "^default\(:\|=\).*$" contains=groupsColonValue
19 syn match groupsGroupsDirKey "^\(groupsdir\|confdir\|autodir\)\(:\|=\).*$" contains=groupsKeys,groupsVars
20
21 " Sources
22 syn match groupsVars "\(\$GROUP\|\$NODE\|$SOURCE\|$CFGDIR\)" contained
23 syn match groupsKeys "^\w\+\(:\|=\)"me=e-1 contained
24 syn match groupsKeyValue "^\(map\|all\|list\|reverse\|cache_time\)\+\(:\|=\).*$" contains=groupsKeys,groupsVars
25
26 syn match groupsComment "#.*$"
27 syn match groupsComment ";.*$"
28 syn match groupsHeader "\[\w\+\(,\w\+\)*\]" contains=gHdrSource,gHdrSourceDelim
29 syn match groupsMainHeader "\[Main\]"
30
31 syn match gHdrSource '[^,]' contained
32 syn match gHdrSourceDelim ',' contained
33
34 " Define the default highlighting.
35 " For version 5.7 and earlier: only when not done already
36 " For version 5.8 and later: only when an item doesn't have highlighting yet
37 if version >= 508 || !exists("did_groupsconf_syntax_inits")
38 if version < 508
39 let did_groupsconf_syntax_inits = 1
40 command -nargs=+ HiLink hi link <args>
41 else
42 command -nargs=+ HiLink hi def link <args>
43 endif
44
45 HiLink gHdrSource Keyword
46 HiLink gHdrSourceDelim Delimiter
47 HiLink groupsComment Comment
48 HiLink groupsMainHeader Constant
49 HiLink groupsDefaultKey Identifier
50 HiLink groupsDefaultValue Special
51 HiLink groupsKeys Identifier
52 HiLink groupsVars Keyword
53
54 delcommand HiLink
55 endif
56
57 let b:current_syntax = "groupsconf"
58
59 " vim:ts=8