blob: 8d4da93a42ff4784ef99d55198fac6d20c8affab [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaarb21e5842006-04-16 18:30:08 +00002" Language: fstab file
3" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
4" Original Maintainer: Radu Dineiu <littledragon@altern.org>
5" License: This file can be redistribued and/or modified under the same terms
6" as Vim itself.
7" URL: http://trific.ath.cx/Ftp/vim/syntax/fstab.vim
8" Last Change: 2006-04-16
9
10" Options: let fstab_unknown_fs_errors = 1 to highlight unknown filesystems
11" as errors
Bram Moolenaar071d4272004-06-13 20:20:40 +000012
13if version < 600
14 syntax clear
15elseif exists("b:current_syntax")
16 finish
17endif
18
19" General
20syn cluster fsGeneralCluster contains=fsComment
21syn match fsComment /\s*#.*/
22syn match fsOperator /[,=]/
23
24" Device
25syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError
Bram Moolenaarb21e5842006-04-16 18:30:08 +000026syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:]\|^\w\{-}\ze\W\)/ contained
27syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts sysfs usbfs
Bram Moolenaar071d4272004-06-13 20:20:40 +000028syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel
29syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator
30
31" Mount Point
32syn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointError
33syn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@]\|\s\+\zs\w\{-}\ze\s\)/ contained
34syn keyword fsMountPointKeyword contained none swap
35
36" Type
Bram Moolenaarb21e5842006-04-16 18:30:08 +000037syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown
38syn match fsTypeUnknown /\s\+\zs\w\+/ contained
39syn keyword fsTypeKeyword contained adfs affs atfs audiofs auto autofs befs bfs cd9660 cfs cifs coda cramfs devfs devpts e2compr efs ext2 ext3 fdesc hfs hpfs iso9660 jffs jffs2 jfs kernfs linprocfs mfs minix msdos ncpfs nfs none none ntfs null nwfs ovlfs portal proc procfs 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000040
41" Options
42" -------
43" Options: General
Bram Moolenaarb21e5842006-04-16 18:30:08 +000044syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeUnknown
Bram Moolenaar071d4272004-06-13 20:20:40 +000045syn match fsOptionsNumber /\d\+/
46syn match fsOptionsNumberOctal /[0-8]\+/
47syn match fsOptionsString /[a-zA-Z0-9_-]\+/
48syn keyword fsOptionsYesNo yes no
49syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck
50syn keyword fsOptionsSize 512 1024 2048
Bram Moolenaarb21e5842006-04-16 18:30:08 +000051syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodiratime noexec nomand nosuid nosymfollow nouser owner rbind rdonly remount ro rq rw suid suiddir supermount sw sync union update user[s] xx
Bram Moolenaar071d4272004-06-13 20:20:40 +000052syn match fsOptionsGeneral /_netdev/
53
54" Options: adfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +000055syn match fsOptionsKeywords contained /\<\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +000056
57" Options: affs
Bram Moolenaarb21e5842006-04-16 18:30:08 +000058syn match fsOptionsKeywords contained /\<\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumber
59syn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsString
60syn match fsOptionsKeywords contained /\<bs=/ nextgroup=fsOptionsSize
Bram Moolenaar071d4272004-06-13 20:20:40 +000061syn keyword fsOptionsKeywords contained protect usemp verbose
62
63" Options: cd9660
64syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet
65
66" Options: devpts
67" -- everything already defined
68
69" Options: ext2
Bram Moolenaarb21e5842006-04-16 18:30:08 +000070syn match fsOptionsKeywords contained /\<check=*/ nextgroup=@fsOptionsCheckCluster
71syn match fsOptionsKeywords contained /\<errors=/ nextgroup=fsOptionsExt2Errors
72syn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +000073syn keyword fsOptionsExt2Check contained none normal strict
74syn keyword fsOptionsExt2Errors contained continue panic
Bram Moolenaarb21e5842006-04-16 18:30:08 +000075syn match fsOptionsExt2Errors contained /\<remount-ro\>/
76syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf noacl nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr
Bram Moolenaar071d4272004-06-13 20:20:40 +000077
78" Options: ext3
Bram Moolenaarb21e5842006-04-16 18:30:08 +000079syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journal
80syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Data
81syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +000082syn keyword fsOptionsExt3Journal contained update inum
83syn keyword fsOptionsExt3Data contained journal ordered writeback
84syn keyword fsOptionsKeywords contained noload
85
86" Options: fat
Bram Moolenaarb21e5842006-04-16 18:30:08 +000087syn match fsOptionsKeywords contained /\<blocksize=/ nextgroup=fsOptionsSize
88syn match fsOptionsKeywords contained /\<\%([dfu]mask\|codepage\)=/ nextgroup=fsOptionsNumberOctal
Bram Moolenaar071d4272004-06-13 20:20:40 +000089syn match fsOptionsKeywords contained /\%(cvf_\%(format\|option\)\|iocharset\)=/ nextgroup=fsOptionsString
Bram Moolenaarb21e5842006-04-16 18:30:08 +000090syn match fsOptionsKeywords contained /\<check=/ nextgroup=@fsOptionsCheckCluster
91syn match fsOptionsKeywords contained /\<conv=*/ nextgroup=fsOptionsConv
92syn match fsOptionsKeywords contained /\<fat=/ nextgroup=fsOptionsFatType
93syn match fsOptionsKeywords contained /\<dotsOK=/ nextgroup=fsOptionsYesNo
Bram Moolenaar071d4272004-06-13 20:20:40 +000094syn keyword fsOptionsFatCheck contained r n s relaxed normal strict
95syn keyword fsOptionsConv contained b t a binary text auto
96syn keyword fsOptionsFatType contained 12 16 32
97syn keyword fsOptionsKeywords contained quiet sys_immutable showexec dots nodots
98
Bram Moolenaarb21e5842006-04-16 18:30:08 +000099" Options: hfs
100syn match fsOptionsKeywords contained /\<\%(creator|type\)=/ nextgroup=fsOptionsString
101syn match fsOptionsKeywords contained /\<\%(dir\|file\|\)_umask=/ nextgroup=fsOptionsNumberOctal
102syn match fsOptionsKeywords contained /\<\%(session\|part\)=/ nextgroup=fsOptionsNumber
103
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104" Options: hpfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000105syn match fsOptionsKeywords contained /\<case=/ nextgroup=fsOptionsHpfsCase
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106syn keyword fsOptionsHpfsCase contained lower asis
107
108" Options: iso9660
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000109syn match fsOptionsKeywords contained /\<map=/ nextgroup=fsOptionsIsoMap
110syn match fsOptionsKeywords contained /\<block=/ nextgroup=fsOptionsSize
111syn match fsOptionsKeywords contained /\<\%(session\|sbsector\)=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000112syn keyword fsOptionsIsoMap contained n o a normal off acorn
113syn keyword fsOptionsKeywords contained norock nojoilet unhide cruft
114syn keyword fsOptionsConv contained m mtext
115
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000116" Options: jfs
117syn keyword fsOptionsKeywords nointegrity integrity
118
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119" Options: nfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000120syn match fsOptionsKeywords contained /\<\%(rsize\|wsize\|timeo\|retrans\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mounthost\|mountprog\|mountvers\|nfsprog\|nfsvers\|namelen\)=/ nextgroup=fsOptionsString
Bram Moolenaar071d4272004-06-13 20:20:40 +0000121syn keyword fsOptionsKeywords contained bg fg soft hard intr cto ac tcp udp lock nobg nofg nosoft nohard nointr noposix nocto noac notcp noudp nolock
122
123" Options: ntfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000124syn match fsOptionsKeywords contained /\<\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125syn keyword fsOptionsKeywords contained utf8
126
127" Options: proc
128" -- everything already defined
129
130" Options: reiserfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000131syn match fsOptionsKeywords contained /\<hash=/ nextgroup=fsOptionsReiserHash
132syn match fsOptionsKeywords contained /\<resize=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133syn keyword fsOptionsReiserHash contained rupasov tea r5 detect
134syn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly
135
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000136" Options: subfs
137syn match fsOptionsKeywords contained /\<fs=/ nextgroup=fsOptionsString
138syn keyword fsOptionsKeywords contained procuid
139
140" Options: swap
141syn match fsOptionsKeywords contained /\<pri=/ nextgroup=fsOptionsNumber
142
143" Options: tmpfs
144syn match fsOptionsKeywords contained /\<nr_\%(blocks\|inodes\)=/ nextgroup=fsOptionsNumber
145
Bram Moolenaar071d4272004-06-13 20:20:40 +0000146" Options: udf
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000147syn match fsOptionsKeywords contained /\<\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsString
Bram Moolenaar071d4272004-06-13 20:20:40 +0000148syn keyword fsOptionsKeywords contained unhide undelete strict novrs
149
150" Options: ufs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000151syn match fsOptionsKeywords contained /\<ufstype=/ nextgroup=fsOptionsUfsType
152syn match fsOptionsKeywords contained /\<onerror=/ nextgroup=fsOptionsUfsError
153syn keyword fsOptionsUfsType contained old hp 44bsd sun sunx86 nextstep openstep
154syn match fsOptionsUfsType contained /\<nextstep-cd\>/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155syn keyword fsOptionsUfsError contained panic lock umount repair
156
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000157" Options: usbfs
158syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)\%(id\|gid\)=/ nextgroup=fsOptionsNumber
159syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)mode=/ nextgroup=fsOptionsNumberOctal
160
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161" Options: vfat
162syn keyword fsOptionsKeywords contained nonumtail posix utf8
163syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortname
164syn keyword fsOptionsVfatShortname contained lower win95 winnt mixed
165
166" Options: xfs
167syn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000168syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce
Bram Moolenaar071d4272004-06-13 20:20:40 +0000169
170" Frequency / Pass No.
171syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassError
172syn match fsFreqPassError /\s\+\zs\%(\D.*\|\S.*\|\d\+\s\+[^012]\)\ze/ contained
173syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained
174
175" Groups
176syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster
177syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained
178syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained
179syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained
180syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained
181
182" Whole line comments
183syn match fsCommentLine /^#.*$/
184
185if version >= 508 || !exists("did_config_syntax_inits")
186 if version < 508
187 let did_config_syntax_inits = 1
188 command! -nargs=+ HiLink hi link <args>
189 else
190 command! -nargs=+ HiLink hi def link <args>
191 endif
192
193 HiLink fsOperator Operator
194 HiLink fsComment Comment
195 HiLink fsCommentLine Comment
196
197 HiLink fsTypeKeyword Type
198 HiLink fsDeviceKeyword Identifier
199 HiLink fsDeviceLabel String
200 HiLink fsFreqPassNumber Number
201
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000202 if exists('fstab_unknown_fs_errors')
203 HiLink fsTypeUnknown Error
204 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000205 HiLink fsDeviceError Error
206 HiLink fsMountPointError Error
207 HiLink fsMountPointKeyword Keyword
208 HiLink fsFreqPassError Error
209
210 HiLink fsOptionsGeneral Type
211 HiLink fsOptionsKeywords Keyword
212 HiLink fsOptionsNumber Number
213 HiLink fsOptionsNumberOctal Number
214 HiLink fsOptionsString String
215 HiLink fsOptionsSize Number
216 HiLink fsOptionsExt2Check String
217 HiLink fsOptionsExt2Errors String
218 HiLink fsOptionsExt3Journal String
219 HiLink fsOptionsExt3Data String
220 HiLink fsOptionsFatCheck String
221 HiLink fsOptionsConv String
222 HiLink fsOptionsFatType Number
223 HiLink fsOptionsYesNo String
224 HiLink fsOptionsHpfsCase String
225 HiLink fsOptionsIsoMap String
226 HiLink fsOptionsReiserHash String
227 HiLink fsOptionsUfsType String
228 HiLink fsOptionsUfsError String
229
230 HiLink fsOptionsVfatShortname String
231
232 delcommand HiLink
233endif
234
235let b:current_syntax = "fstab"
236
237" vim: ts=8 ft=vim