Mercurial > hg > RemoteEditor > vim7
comparison runtime/syntax/fstab.vim @ 0:76efa0be13f1
Initial revision
author | atsuki |
---|---|
date | Sat, 10 Nov 2007 15:07:22 +0900 |
parents | |
children | e170173ecb68 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:76efa0be13f1 |
---|---|
1 " Vim syntax file | |
2 " Language: fstab file | |
3 " Maintaner: Radu Dineiu <radu.dineiu@gmail.com> | |
4 " URL: http://ld.yi.org/vim/fstab.vim | |
5 " Last Change: 2007 Apr 24 | |
6 " Version: 0.91 | |
7 " | |
8 " Credits: | |
9 " David Necas (Yeti) <yeti@physics.muni.cz> | |
10 " Stefano Zacchiroli <zack@debian.org> | |
11 " Georgi Georgiev <chutz@gg3.net> | |
12 " | |
13 " Options: | |
14 " let fstab_unknown_fs_errors = 1 | |
15 " highlight unknown filesystems as errors | |
16 | |
17 if version < 600 | |
18 syntax clear | |
19 elseif exists("b:current_syntax") | |
20 finish | |
21 endif | |
22 | |
23 " General | |
24 syn cluster fsGeneralCluster contains=fsComment | |
25 syn match fsComment /\s*#.*/ | |
26 syn match fsOperator /[,=:]/ | |
27 | |
28 " Device | |
29 syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError | |
30 syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained | |
31 syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts sysfs usbfs | |
32 syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel | |
33 syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID | |
34 syn match fsDeviceKeyword contained /^[a-zA-Z0-9.\-]\+\ze:/ | |
35 syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator | |
36 syn match fsDeviceUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator | |
37 | |
38 " Mount Point | |
39 syn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointError | |
40 syn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@\.-]\|\s\+\zs\w\{-}\ze\s\)/ contained | |
41 syn keyword fsMountPointKeyword contained none swap | |
42 | |
43 " Type | |
44 syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown | |
45 syn match fsTypeUnknown /\s\+\zs\w\+/ contained | |
46 syn keyword fsTypeKeyword contained adfs ados affs atfs audiofs auto autofs befs bfs cd9660 cfs cifs coda cramfs devfs devpts e2compr efs ext2 ext2fs ext3 fdesc ffs filecore hfs hpfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix msdos ncpfs nfs none ntfs null nwfs overlay ovlfs portal proc procfs ptyfs qnx4 reiserfs romfs shm smbfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xfs zisofs | |
47 | |
48 " Options | |
49 " ------- | |
50 " Options: General | |
51 syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeUnknown | |
52 syn match fsOptionsNumber /\d\+/ | |
53 syn match fsOptionsNumberOctal /[0-8]\+/ | |
54 syn match fsOptionsString /[a-zA-Z0-9_-]\+/ | |
55 syn keyword fsOptionsYesNo yes no | |
56 syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck | |
57 syn keyword fsOptionsSize 512 1024 2048 | |
58 syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand nosuid nosymfollow nouser owner rbind rdonly remount ro rq rw suid suiddir supermount sw sync union update user users xx | |
59 syn match fsOptionsGeneral /_netdev/ | |
60 | |
61 " Options: adfs | |
62 syn match fsOptionsKeywords contained /\<\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber | |
63 | |
64 " Options: affs | |
65 syn match fsOptionsKeywords contained /\<\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumber | |
66 syn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsString | |
67 syn match fsOptionsKeywords contained /\<bs=/ nextgroup=fsOptionsSize | |
68 syn keyword fsOptionsKeywords contained protect usemp verbose | |
69 | |
70 " Options: cd9660 | |
71 syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet | |
72 | |
73 " Options: devpts | |
74 " -- everything already defined | |
75 | |
76 " Options: ext2 | |
77 syn match fsOptionsKeywords contained /\<check=*/ nextgroup=@fsOptionsCheckCluster | |
78 syn match fsOptionsKeywords contained /\<errors=/ nextgroup=fsOptionsExt2Errors | |
79 syn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumber | |
80 syn keyword fsOptionsExt2Check contained none normal strict | |
81 syn keyword fsOptionsExt2Errors contained continue panic | |
82 syn match fsOptionsExt2Errors contained /\<remount-ro\>/ | |
83 syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf noacl nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr | |
84 | |
85 " Options: ext3 | |
86 syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journal | |
87 syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Data | |
88 syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber | |
89 syn keyword fsOptionsExt3Journal contained update inum | |
90 syn keyword fsOptionsExt3Data contained journal ordered writeback | |
91 syn keyword fsOptionsKeywords contained noload | |
92 | |
93 " Options: fat | |
94 syn match fsOptionsKeywords contained /\<blocksize=/ nextgroup=fsOptionsSize | |
95 syn match fsOptionsKeywords contained /\<\%([dfu]mask\|codepage\)=/ nextgroup=fsOptionsNumberOctal | |
96 syn match fsOptionsKeywords contained /\%(cvf_\%(format\|option\)\|iocharset\)=/ nextgroup=fsOptionsString | |
97 syn match fsOptionsKeywords contained /\<check=/ nextgroup=@fsOptionsCheckCluster | |
98 syn match fsOptionsKeywords contained /\<conv=*/ nextgroup=fsOptionsConv | |
99 syn match fsOptionsKeywords contained /\<fat=/ nextgroup=fsOptionsFatType | |
100 syn match fsOptionsKeywords contained /\<dotsOK=/ nextgroup=fsOptionsYesNo | |
101 syn keyword fsOptionsFatCheck contained r n s relaxed normal strict | |
102 syn keyword fsOptionsConv contained b t a binary text auto | |
103 syn keyword fsOptionsFatType contained 12 16 32 | |
104 syn keyword fsOptionsKeywords contained quiet sys_immutable showexec dots nodots | |
105 | |
106 " Options: hfs | |
107 syn match fsOptionsKeywords contained /\<\%(creator|type\)=/ nextgroup=fsOptionsString | |
108 syn match fsOptionsKeywords contained /\<\%(dir\|file\|\)_umask=/ nextgroup=fsOptionsNumberOctal | |
109 syn match fsOptionsKeywords contained /\<\%(session\|part\)=/ nextgroup=fsOptionsNumber | |
110 | |
111 " Options: ffs | |
112 syn keyword fsOptionsKeyWords contained softdep | |
113 | |
114 " Options: hpfs | |
115 syn match fsOptionsKeywords contained /\<case=/ nextgroup=fsOptionsHpfsCase | |
116 syn keyword fsOptionsHpfsCase contained lower asis | |
117 | |
118 " Options: iso9660 | |
119 syn match fsOptionsKeywords contained /\<map=/ nextgroup=fsOptionsIsoMap | |
120 syn match fsOptionsKeywords contained /\<block=/ nextgroup=fsOptionsSize | |
121 syn match fsOptionsKeywords contained /\<\%(session\|sbsector\)=/ nextgroup=fsOptionsNumber | |
122 syn keyword fsOptionsIsoMap contained n o a normal off acorn | |
123 syn keyword fsOptionsKeywords contained norock nojoilet unhide cruft | |
124 syn keyword fsOptionsConv contained m mtext | |
125 | |
126 " Options: jfs | |
127 syn keyword fsOptionsKeywords nointegrity integrity | |
128 | |
129 " Options: nfs | |
130 syn match fsOptionsKeywords contained /\<\%(rsize\|wsize\|timeo\|retrans\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mounthost\|mountprog\|mountvers\|nfsprog\|nfsvers\|namelen\)=/ nextgroup=fsOptionsString | |
131 syn keyword fsOptionsKeywords contained bg fg soft hard intr cto ac tcp udp lock nobg nofg nosoft nohard nointr noposix nocto noac notcp noudp nolock | |
132 | |
133 " Options: ntfs | |
134 syn match fsOptionsKeywords contained /\<\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumber | |
135 syn keyword fsOptionsKeywords contained utf8 | |
136 | |
137 " Options: proc | |
138 " -- everything already defined | |
139 | |
140 " Options: reiserfs | |
141 syn match fsOptionsKeywords contained /\<hash=/ nextgroup=fsOptionsReiserHash | |
142 syn match fsOptionsKeywords contained /\<resize=/ nextgroup=fsOptionsNumber | |
143 syn keyword fsOptionsReiserHash contained rupasov tea r5 detect | |
144 syn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly | |
145 | |
146 " Options: subfs | |
147 syn match fsOptionsKeywords contained /\<fs=/ nextgroup=fsOptionsString | |
148 syn keyword fsOptionsKeywords contained procuid | |
149 | |
150 " Options: swap | |
151 syn match fsOptionsKeywords contained /\<pri=/ nextgroup=fsOptionsNumber | |
152 | |
153 " Options: tmpfs | |
154 syn match fsOptionsKeywords contained /\<nr_\%(blocks\|inodes\)=/ nextgroup=fsOptionsNumber | |
155 | |
156 " Options: udf | |
157 syn match fsOptionsKeywords contained /\<\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsString | |
158 syn keyword fsOptionsKeywords contained unhide undelete strict novrs | |
159 | |
160 " Options: ufs | |
161 syn match fsOptionsKeywords contained /\<ufstype=/ nextgroup=fsOptionsUfsType | |
162 syn match fsOptionsKeywords contained /\<onerror=/ nextgroup=fsOptionsUfsError | |
163 syn keyword fsOptionsUfsType contained old hp 44bsd sun sunx86 nextstep openstep | |
164 syn match fsOptionsUfsType contained /\<nextstep-cd\>/ | |
165 syn keyword fsOptionsUfsError contained panic lock umount repair | |
166 | |
167 " Options: usbfs | |
168 syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)\%(id\|gid\)=/ nextgroup=fsOptionsNumber | |
169 syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)mode=/ nextgroup=fsOptionsNumberOctal | |
170 | |
171 " Options: vfat | |
172 syn keyword fsOptionsKeywords contained nonumtail posix utf8 | |
173 syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortname | |
174 syn keyword fsOptionsVfatShortname contained lower win95 winnt mixed | |
175 | |
176 " Options: xfs | |
177 syn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString | |
178 syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce | |
179 | |
180 " Frequency / Pass No. | |
181 syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassError | |
182 syn match fsFreqPassError /\s\+\zs\%(\D.*\|\S.*\|\d\+\s\+[^012]\)\ze/ contained | |
183 syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained | |
184 | |
185 " Groups | |
186 syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster | |
187 syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained | |
188 syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained | |
189 syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained | |
190 syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained | |
191 | |
192 " Whole line comments | |
193 syn match fsCommentLine /^#.*$/ | |
194 | |
195 if version >= 508 || !exists("did_config_syntax_inits") | |
196 if version < 508 | |
197 let did_config_syntax_inits = 1 | |
198 command! -nargs=+ HiLink hi link <args> | |
199 else | |
200 command! -nargs=+ HiLink hi def link <args> | |
201 endif | |
202 | |
203 HiLink fsOperator Operator | |
204 HiLink fsComment Comment | |
205 HiLink fsCommentLine Comment | |
206 | |
207 HiLink fsTypeKeyword Type | |
208 HiLink fsDeviceKeyword Identifier | |
209 HiLink fsDeviceLabel String | |
210 HiLink fsDeviceUUID String | |
211 HiLink fsFreqPassNumber Number | |
212 | |
213 if exists('fstab_unknown_fs_errors') && fstab_unknown_fs_errors == 1 | |
214 HiLink fsTypeUnknown Error | |
215 endif | |
216 HiLink fsDeviceError Error | |
217 HiLink fsMountPointError Error | |
218 HiLink fsMountPointKeyword Keyword | |
219 HiLink fsFreqPassError Error | |
220 | |
221 HiLink fsOptionsGeneral Type | |
222 HiLink fsOptionsKeywords Keyword | |
223 HiLink fsOptionsNumber Number | |
224 HiLink fsOptionsNumberOctal Number | |
225 HiLink fsOptionsString String | |
226 HiLink fsOptionsSize Number | |
227 HiLink fsOptionsExt2Check String | |
228 HiLink fsOptionsExt2Errors String | |
229 HiLink fsOptionsExt3Journal String | |
230 HiLink fsOptionsExt3Data String | |
231 HiLink fsOptionsFatCheck String | |
232 HiLink fsOptionsConv String | |
233 HiLink fsOptionsFatType Number | |
234 HiLink fsOptionsYesNo String | |
235 HiLink fsOptionsHpfsCase String | |
236 HiLink fsOptionsIsoMap String | |
237 HiLink fsOptionsReiserHash String | |
238 HiLink fsOptionsUfsType String | |
239 HiLink fsOptionsUfsError String | |
240 | |
241 HiLink fsOptionsVfatShortname String | |
242 | |
243 delcommand HiLink | |
244 endif | |
245 | |
246 let b:current_syntax = "fstab" | |
247 | |
248 " vim: ts=8 ft=vim |