glusterfs

Форк
0
/
glusterfs.vim 
202 строки · 8.5 Кб
1
" glusterfs.vim: GNU Vim Syntax file for GlusterFS .vol specification
2
"  Copyright (c) 2007777777Red Hat, Inc. <http://www.redhat.com>
3
"  This file is part of GlusterFS.
4
"
5
"  This file is licensed to you under your choice of the GNU Lesser
6
"  General Public License, version 3 or any later version (LGPLv3 or
7
"  later), or the GNU General Public License, version 2 (GPLv2), in all
8
"  cases as published by the Free Software Foundation.
9
"
10
" Last Modified: Wed Aug  1 00:47:10 IST 2007
11
" Version: 0.8 
12

13
syntax clear
14
syntax case match
15

16
setlocal iskeyword+=-
17
setlocal iskeyword+=%
18
setlocal iskeyword+=.
19
setlocal iskeyword+=*
20
setlocal iskeyword+=:
21
setlocal iskeyword+=,
22

23

24
"************************************************************************
25
" Initially, consider everything an error. Then start eliminating one
26
"   field after the other. Whatever is not eliminated (due to defined
27
"   properties) is an error - Multiples Values for a key
28
"************************************************************************
29
syn match glusterfsError /[^ 	]\+/ skipwhite
30
syn match glusterfsComment "#.*" contains=glusterfsTodo
31

32
syn keyword	glusterfsTodo	contained TODO FIXME NOTE
33

34
"------------------------------------------------------------------------
35
" 'Type' Begin
36
"------------------------------------------------------------------------
37
" Handle all the 'Type' keys and values. Here, a '/' is used to separate
38
" the key-value pair, they are clubbed together for convenience
39
syn match glusterfsType "^\s*type\s\+" skipwhite nextgroup=glusterfsTypeKeyVal
40

41
syn match glusterfsTypeKeyVal contained "\<protocol/\(client\|server\)\>"
42
syn match glusterfsTypeKeyVal contained "\<cluster/\(unify\|afr\|stripe\)\>"
43
syn match glusterfsTypeKeyVal contained "\<debug/\(trace\)\>"
44
syn match glusterfsTypeKeyVal contained "\<encryption/\(rot-13\)\>"
45
syn match glusterfsTypeKeyVal contained "\<storage/\(posix\)\>"
46
"syn match glusterfsTypeKeyVal contained "\<features/\(trash\)\>"
47
syn match glusterfsTypeKeyVal contained "\<features/\(trash\|posix-locks\|fixed-id\|filter\)\>"
48
syn match glusterfsTypeKeyVal contained "\<performance/\(io-threads\|write-behind\|io-cache\|read-ahead\)\>"
49
"------------------------------------------------------------------------
50
" 'Type' End
51
"------------------------------------------------------------------------
52

53

54
"************************************************************************
55

56
"------------------------------------------------------------------------
57
" 'Volume' Begin
58
"------------------------------------------------------------------------
59
" NOTE 1: Only one volume name allowed after 'volume' keyword
60
" NOTE 2: Multiple volumes allowed after 'subvolumes'
61
" NOTE 3: Some other options (like remote-subvolume, namespace etc) use
62
"   volume name (single)
63
syn match glusterfsVol "^\s*volume\s\+" nextgroup=glusterfsVolName
64
syn match glusterfsVolName "\<\k\+" contained
65

66
syn match glusterfsVol "^\s*subvolumes\s\+" skipwhite nextgroup=glusterfsSubVolName
67
syn match glusterfsSubVolName "\<\k\+\>" skipwhite contained nextgroup=glusterfsSubVolName
68

69
syn match glusterfsVol "^\s*end-volume\>"
70
"------------------------------------------------------------------------
71
" 'Volume' End
72
"------------------------------------------------------------------------
73

74

75

76

77

78
"------------------------------------------------------------------------
79
" 'Options' Begin
80
"------------------------------------------------------------------------
81
syn match glusterfsOpt "^\s*option\s\+" nextgroup=glusterfsOptKey
82

83

84
syn keyword glusterfsOptKey contained transport-type skipwhite nextgroup=glusterfsOptValTransportType
85
syn match glusterfsOptValTransportType contained "\<\(tcp\|ib\-verbs\|ib-sdp\)/\(client\|server\)\>"
86

87
syn keyword glusterfsOptKey contained remote-subvolume skipwhite nextgroup=glusterfsVolName
88

89
syn keyword glusterfsOptKey contained auth.addr.ra8.allow auth.addr.ra7.allow auth.addr.ra6.allow auth.addr.ra5.allow auth.addr.ra4.allow auth.addr.ra3.allow auth.addr.ra2.allow auth.addr.ra1.allow auth.addr.brick-ns.allow skipwhite nextgroup=glusterfsOptVal
90

91
syn keyword glusterfsOptKey contained client-volume-filename directory trash-dir skipwhite nextgroup=glusterfsOpt_Path
92
syn match glusterfsOpt_Path contained "\s\+\f\+\>"
93

94
syn keyword glusterfsOptKey contained debug self-heal encrypt-write decrypt-read mandatory nextgroup=glusterfsOpt_OnOff
95
syn match glusterfsOpt_OnOff contained "\s\+\(on\|off\)\>"
96

97
syn keyword glusterfsOptKey contained flush-behind non-blocking-connect nextgroup=glusterfsOpt_OnOffNoYes
98
syn keyword glusterfsOpt_OnOffNoYes contained on off no yes
99

100
syn keyword glusterfsOptKey contained page-size cache-size nextgroup=glusterfsOpt_Size
101

102
syn keyword glusterfsOptKey contained fixed-gid fixed-uid cache-seconds page-count thread-count aggregate-size listen-port remote-port transport-timeout inode-lru-limit nextgroup=glusterfsOpt_Number
103

104
syn keyword glusterfsOptKey contained alu.disk-usage.entry-threshold alu.disk-usage.exit-threshold nextgroup=glusterfsOpt_Size
105

106
syn keyword glusterfsOptKey contained alu.order skipwhite nextgroup=glusterfsOptValAluOrder
107
syn match glusterfsOptValAluOrder contained "\s\+\(\(disk-usage\|write-usage\|read-usage\|open-files-usage\|disk-speed\):\)*\(disk-usage\|write-usage\|read-usage\|open-files-usage\|disk-speed\)\>"
108

109
syn keyword glusterfsOptKey contained alu.open-files-usage.entry-threshold alu.open-files-usage.exit-threshold alu.limits.max-open-files rr.refresh-interval random.refresh-interval nufa.refresh-interval nextgroup=glusterfsOpt_Number
110

111
syn keyword glusterfsOptKey contained nufa.local-volume-name skipwhite nextgroup=glusterfsVolName
112

113
syn keyword glusterfsOptKey contained ib-verbs-work-request-send-size ib-verbs-work-request-recv-size nextgroup=glusterfsOpt_Size
114
syn match glusterfsOpt_Size contained "\s\+\d\+\([gGmMkK][bB]\)\=\>"
115

116
syn keyword glusterfsOptKey contained ib-verbs-work-request-send-count ib-verbs-work-request-recv-count ib-verbs-port nextgroup=glusterfsOpt_Number
117

118
syn keyword glusterfsOptKey contained ib-verbs-mtu nextgroup=glusterfsOptValIBVerbsMtu
119
syn match glusterfsOptValIBVerbsMtu "\s\+\(256\|512\|1024\|2048\|4096\)\>" contained
120

121
syn keyword glusterfsOptKey contained ib-verbs-device-name nextgroup=glusterfsOptVal
122

123
syn match glusterfsOpt_Number contained "\s\+\d\+\>"
124

125
syn keyword glusterfsOptKey contained scheduler skipwhite nextgroup=glusterfsOptValScheduler
126
syn keyword glusterfsOptValScheduler contained rr alu random nufa
127

128
syn keyword glusterfsOptKey contained namespace skipwhite nextgroup=glusterfsVolName
129

130
syn keyword glusterfsOptKey contained lock-node skipwhite nextgroup=glusterfsVolName
131

132

133

134
syn keyword glusterfsOptKey contained alu.write-usage.entry-threshold alu.write-usage.exit-threshold alu.read-usage.entry-threshold alu.read-usage.exit-threshold alu.limits.min-free-disk nextgroup=glusterfsOpt_Percentage
135

136
syn keyword glusterfsOptKey contained random.limits.min-free-disk nextgroup=glusterfsOpt_Percentage
137
syn keyword glusterfsOptKey contained rr.limits.min-disk-free nextgroup=glusterfsOpt_Size
138

139
syn keyword glusterfsOptKey contained nufa.limits.min-free-disk nextgroup=glusterfsOpt_Percentage
140

141
syn match glusterfsOpt_Percentage contained "\s\+\d\+%\=\>"
142

143

144

145

146

147

148

149

150

151
syn keyword glusterfsOptKey contained remote-host bind-address nextgroup=glusterfsOpt_IP,glusterfsOpt_Domain
152
syn match glusterfsOpt_IP contained "\s\+\d\d\=\d\=\.\d\d\=\d\=\.\d\d\=\d\=\.\d\d\=\d\=\>"
153
syn match glusterfsOpt_Domain contained "\s\+\a[a-zA-Z0-9_-]*\(\.\a\+\)*\>"
154

155
syn match glusterfsVolNames "\s*\<\S\+\>" contained skipwhite nextgroup=glusterfsVolNames
156

157
syn keyword glusterfsOptKey contained block-size replicate skipwhite nextgroup=glusterfsOpt_Pattern
158

159
syn match glusterfsOpt_Pattern contained "\s\+\k\+\>"
160
syn match glusterfsOptVal contained "\s\+\S\+\>"
161

162

163

164

165

166
hi link glusterfsError Error
167
hi link glusterfsComment Comment
168

169
hi link glusterfsVol keyword
170

171
hi link glusterfsVolName function
172
hi link glusterfsSubVolName function
173

174
hi link glusterfsType Keyword
175
hi link glusterfsTypeKeyVal String
176

177
hi link glusterfsOpt Keyword
178

179
hi link glusterfsOptKey Special
180
hi link glusterfsOptVal Normal
181

182
hi link glusterfsOptValTransportType String
183
hi link glusterfsOptValScheduler String
184
hi link glusterfsOptValAluOrder String
185
hi link glusterfsOptValIBVerbsMtu String
186

187
hi link glusterfsOpt_OnOff String
188
hi link glusterfsOpt_OnOffNoYes String
189

190

191
" Options that require
192
hi link glusterfsOpt_Size PreProc
193
hi link glusterfsOpt_Domain PreProc
194
hi link glusterfsOpt_Percentage PreProc
195
hi link glusterfsOpt_IP PreProc
196
hi link glusterfsOpt_Pattern PreProc
197
hi link glusterfsOpt_Number Preproc
198
hi link glusterfsOpt_Path Preproc
199

200

201

202
let b:current_syntax = "glusterfs"
203

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.