blob: defb85ea9175b0da318f0aae0ef6e3852ed8f8f0 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: fstab file
3" Maintaner: Radu Dineiu <littledragon@altern.org>
4" URL: http://ld.yi.org/vim/fstab.vim
5" ChangeLog: http://ld.yi.org/vim/fstab.ChangeLog
Bram Moolenaar8e735a12005-07-08 22:14:37 +00006" Last Change: 2005 Jul 07
Bram Moolenaar071d4272004-06-13 20:20:40 +00007" Version: 0.61
8
9if version < 600
10 syntax clear
11elseif exists("b:current_syntax")
12 finish
13endif
14
15" General
16syn cluster fsGeneralCluster contains=fsComment
17syn match fsComment /\s*#.*/
18syn match fsOperator /[,=]/
19
20" Device
21syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError
22syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@]\|^\w\{-}\ze\W\)/ contained
23syn keyword fsDeviceKeyword contained none proc linproc tmpfs
24syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel
25syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator
26
27" Mount Point
28syn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointError
29syn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@]\|\s\+\zs\w\{-}\ze\s\)/ contained
30syn keyword fsMountPointKeyword contained none swap
31
32" Type
33syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeError
34syn match fsTypeError /\s\+\zs\w\+/ contained
Bram Moolenaar8e735a12005-07-08 22:14:37 +000035syn keyword fsTypeKeyword contained adfs affs auto autofs cd9660 coda cramfs devfs devpts efs ext2 ext3 fdesc hfs hpfs iso9660 kernfs linprocfs mfs minix msdos ncpfs nfs ntfs nwfs null portal proc procfs qnx4 reiserfs romfs smbfs std sysv swap tmpfs udf ufs umap umsdos union usbfs vfat xfs
Bram Moolenaar071d4272004-06-13 20:20:40 +000036
37" Options
38" -------
39" Options: General
40syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeError
41syn match fsOptionsNumber /\d\+/
42syn match fsOptionsNumberOctal /[0-8]\+/
43syn match fsOptionsString /[a-zA-Z0-9_-]\+/
44syn keyword fsOptionsYesNo yes no
45syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck
46syn keyword fsOptionsSize 512 1024 2048
47syn keyword fsOptionsGeneral async atime auto current defaults dev exec force fstab noatime noauto noclusterr noclusterw nodev noexec nosuid nosymfollow nouser owner ro rdonly rw rq sw xx suid suiddir sync kudzu union update user supermount
48syn match fsOptionsGeneral /_netdev/
49
50" Options: adfs
51syn match fsOptionsKeywords contained /\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber
52
53" Options: affs
54syn match fsOptionsKeywords contained /\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumber
55syn match fsOptionsKeywords contained /\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsString
56syn match fsOptionsKeywords contained /bs=/ nextgroup=fsOptionsSize
57syn keyword fsOptionsKeywords contained protect usemp verbose
58
59" Options: cd9660
60syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet
61
62" Options: devpts
63" -- everything already defined
64
65" Options: ext2
66syn match fsOptionsKeywords contained /check=*/ nextgroup=@fsOptionsCheckCluster
67syn match fsOptionsKeywords contained /errors=/ nextgroup=fsOptionsExt2Errors
68syn match fsOptionsKeywords contained /\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumber
69syn keyword fsOptionsExt2Check contained none normal strict
70syn keyword fsOptionsExt2Errors contained continue panic
71syn match fsOptionsExt2Errors contained /remount-ro/
72syn keyword fsOptionsKeywords contained bsddf minixdf debug grpid bsdgroups nocheck nogrpid sysvgroups nouid32
73
74" Options: ext3
75syn match fsOptionsKeywords contained /journal=/ nextgroup=fsOptionsExt3Journal
76syn match fsOptionsKeywords contained /data=/ nextgroup=fsOptionsExt3Data
77syn keyword fsOptionsExt3Journal contained update inum
78syn keyword fsOptionsExt3Data contained journal ordered writeback
79syn keyword fsOptionsKeywords contained noload
80
81" Options: fat
82syn match fsOptionsKeywords contained /blocksize=/ nextgroup=fsOptionsSize
83syn match fsOptionsKeywords contained /\%([dfu]mask\|codepage\)=/ nextgroup=fsOptionsNumberOctal
84syn match fsOptionsKeywords contained /\%(cvf_\%(format\|option\)\|iocharset\)=/ nextgroup=fsOptionsString
85syn match fsOptionsKeywords contained /check=/ nextgroup=@fsOptionsCheckCluster
86syn match fsOptionsKeywords contained /conv=*/ nextgroup=fsOptionsConv
87syn match fsOptionsKeywords contained /fat=/ nextgroup=fsOptionsFatType
88syn match fsOptionsKeywords contained /dotsOK=/ nextgroup=fsOptionsYesNo
89syn keyword fsOptionsFatCheck contained r n s relaxed normal strict
90syn keyword fsOptionsConv contained b t a binary text auto
91syn keyword fsOptionsFatType contained 12 16 32
92syn keyword fsOptionsKeywords contained quiet sys_immutable showexec dots nodots
93
94" Options: hpfs
95syn match fsOptionsKeywords contained /case=/ nextgroup=fsOptionsHpfsCase
96syn keyword fsOptionsHpfsCase contained lower asis
97
98" Options: iso9660
99syn match fsOptionsKeywords contained /map=/ nextgroup=fsOptionsIsoMap
100syn match fsOptionsKeywords contained /block=/ nextgroup=fsOptionsSize
101syn match fsOptionsKeywords contained /\%(session\|sbsector\)=/ nextgroup=fsOptionsNumber
102syn keyword fsOptionsIsoMap contained n o a normal off acorn
103syn keyword fsOptionsKeywords contained norock nojoilet unhide cruft
104syn keyword fsOptionsConv contained m mtext
105
106" Options: nfs
107syn match fsOptionsKeywords contained /\%(rsize\|wsize\|timeo\|retrans\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mounthost\|mountprog\|mountvers\|nfsprog\|nfsvers\|namelen\)=/ nextgroup=fsOptionsString
108syn keyword fsOptionsKeywords contained bg fg soft hard intr cto ac tcp udp lock nobg nofg nosoft nohard nointr noposix nocto noac notcp noudp nolock
109
110" Options: ntfs
111syn match fsOptionsKeywords contained /\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumber
112syn keyword fsOptionsKeywords contained utf8
113
114" Options: proc
115" -- everything already defined
116
117" Options: reiserfs
118syn match fsOptionsKeywords contained /hash=/ nextgroup=fsOptionsReiserHash
119syn match fsOptionsKeywords contained /resize=/ nextgroup=fsOptionsNumber
120syn keyword fsOptionsReiserHash contained rupasov tea r5 detect
121syn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly
122
123" Options: udf
124syn match fsOptionsKeywords contained /\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsString
125syn keyword fsOptionsKeywords contained unhide undelete strict novrs
126
127" Options: ufs
128syn match fsOptionsKeywords contained /ufstype=/ nextgroup=fsOptionsUfsType
129syn match fsOptionsKeywords contained /onerror=/ nextgroup=fsOptionsUfsError
130syn keyword fsOptionsUfsType contained old 44bsd sun sunx86 nextstep openstep
131syn match fsOptionsUfsType contained /nextstep-cd/
132syn keyword fsOptionsUfsError contained panic lock umount repair
133
134" Options: vfat
135syn keyword fsOptionsKeywords contained nonumtail posix utf8
136syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortname
137syn keyword fsOptionsVfatShortname contained lower win95 winnt mixed
138
139" Options: xfs
140syn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString
141syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime norecovery osyncisdsync quota usrquota uquoenforce grpquota gquoenforce
142
143" Frequency / Pass No.
144syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassError
145syn match fsFreqPassError /\s\+\zs\%(\D.*\|\S.*\|\d\+\s\+[^012]\)\ze/ contained
146syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained
147
148" Groups
149syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster
150syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained
151syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained
152syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained
153syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained
154
155" Whole line comments
156syn match fsCommentLine /^#.*$/
157
158if version >= 508 || !exists("did_config_syntax_inits")
159 if version < 508
160 let did_config_syntax_inits = 1
161 command! -nargs=+ HiLink hi link <args>
162 else
163 command! -nargs=+ HiLink hi def link <args>
164 endif
165
166 HiLink fsOperator Operator
167 HiLink fsComment Comment
168 HiLink fsCommentLine Comment
169
170 HiLink fsTypeKeyword Type
171 HiLink fsDeviceKeyword Identifier
172 HiLink fsDeviceLabel String
173 HiLink fsFreqPassNumber Number
174
175 HiLink fsTypeError Error
176 HiLink fsDeviceError Error
177 HiLink fsMountPointError Error
178 HiLink fsMountPointKeyword Keyword
179 HiLink fsFreqPassError Error
180
181 HiLink fsOptionsGeneral Type
182 HiLink fsOptionsKeywords Keyword
183 HiLink fsOptionsNumber Number
184 HiLink fsOptionsNumberOctal Number
185 HiLink fsOptionsString String
186 HiLink fsOptionsSize Number
187 HiLink fsOptionsExt2Check String
188 HiLink fsOptionsExt2Errors String
189 HiLink fsOptionsExt3Journal String
190 HiLink fsOptionsExt3Data String
191 HiLink fsOptionsFatCheck String
192 HiLink fsOptionsConv String
193 HiLink fsOptionsFatType Number
194 HiLink fsOptionsYesNo String
195 HiLink fsOptionsHpfsCase String
196 HiLink fsOptionsIsoMap String
197 HiLink fsOptionsReiserHash String
198 HiLink fsOptionsUfsType String
199 HiLink fsOptionsUfsError String
200
201 HiLink fsOptionsVfatShortname String
202
203 delcommand HiLink
204endif
205
206let b:current_syntax = "fstab"
207
208" vim: ts=8 ft=vim