blob: 9cb76cb1fe6a557b58a140a3c4973fba9a24ea58 [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
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +00003" 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000016
17if version < 600
18 syntax clear
19elseif exists("b:current_syntax")
20 finish
21endif
22
23" General
24syn cluster fsGeneralCluster contains=fsComment
25syn match fsComment /\s*#.*/
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +000026syn match fsOperator /[,=:]/
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
28" Device
29syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +000030syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained
Bram Moolenaarb21e5842006-04-16 18:30:08 +000031syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts sysfs usbfs
Bram Moolenaar071d4272004-06-13 20:20:40 +000032syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +000033syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID
34syn match fsDeviceKeyword contained /^[a-zA-Z0-9.\-]\+\ze:/
Bram Moolenaar071d4272004-06-13 20:20:40 +000035syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +000036syn match fsDeviceUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator
Bram Moolenaar071d4272004-06-13 20:20:40 +000037
38" Mount Point
39syn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointError
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +000040syn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@\.-]\|\s\+\zs\w\{-}\ze\s\)/ contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000041syn keyword fsMountPointKeyword contained none swap
42
43" Type
Bram Moolenaarb21e5842006-04-16 18:30:08 +000044syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown
45syn match fsTypeUnknown /\s\+\zs\w\+/ contained
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +000046syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000047
48" Options
49" -------
50" Options: General
Bram Moolenaarb21e5842006-04-16 18:30:08 +000051syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeUnknown
Bram Moolenaar071d4272004-06-13 20:20:40 +000052syn match fsOptionsNumber /\d\+/
53syn match fsOptionsNumberOctal /[0-8]\+/
54syn match fsOptionsString /[a-zA-Z0-9_-]\+/
55syn keyword fsOptionsYesNo yes no
56syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck
57syn keyword fsOptionsSize 512 1024 2048
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +000058syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000059syn match fsOptionsGeneral /_netdev/
60
61" Options: adfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +000062syn match fsOptionsKeywords contained /\<\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +000063
64" Options: affs
Bram Moolenaarb21e5842006-04-16 18:30:08 +000065syn match fsOptionsKeywords contained /\<\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumber
66syn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsString
67syn match fsOptionsKeywords contained /\<bs=/ nextgroup=fsOptionsSize
Bram Moolenaar071d4272004-06-13 20:20:40 +000068syn keyword fsOptionsKeywords contained protect usemp verbose
69
70" Options: cd9660
71syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet
72
73" Options: devpts
74" -- everything already defined
75
76" Options: ext2
Bram Moolenaarb21e5842006-04-16 18:30:08 +000077syn match fsOptionsKeywords contained /\<check=*/ nextgroup=@fsOptionsCheckCluster
78syn match fsOptionsKeywords contained /\<errors=/ nextgroup=fsOptionsExt2Errors
79syn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +000080syn keyword fsOptionsExt2Check contained none normal strict
81syn keyword fsOptionsExt2Errors contained continue panic
Bram Moolenaarb21e5842006-04-16 18:30:08 +000082syn match fsOptionsExt2Errors contained /\<remount-ro\>/
83syn 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 +000084
85" Options: ext3
Bram Moolenaarb21e5842006-04-16 18:30:08 +000086syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journal
87syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Data
88syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +000089syn keyword fsOptionsExt3Journal contained update inum
90syn keyword fsOptionsExt3Data contained journal ordered writeback
91syn keyword fsOptionsKeywords contained noload
92
93" Options: fat
Bram Moolenaarb21e5842006-04-16 18:30:08 +000094syn match fsOptionsKeywords contained /\<blocksize=/ nextgroup=fsOptionsSize
95syn match fsOptionsKeywords contained /\<\%([dfu]mask\|codepage\)=/ nextgroup=fsOptionsNumberOctal
Bram Moolenaar071d4272004-06-13 20:20:40 +000096syn match fsOptionsKeywords contained /\%(cvf_\%(format\|option\)\|iocharset\)=/ nextgroup=fsOptionsString
Bram Moolenaarb21e5842006-04-16 18:30:08 +000097syn match fsOptionsKeywords contained /\<check=/ nextgroup=@fsOptionsCheckCluster
98syn match fsOptionsKeywords contained /\<conv=*/ nextgroup=fsOptionsConv
99syn match fsOptionsKeywords contained /\<fat=/ nextgroup=fsOptionsFatType
100syn match fsOptionsKeywords contained /\<dotsOK=/ nextgroup=fsOptionsYesNo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000101syn keyword fsOptionsFatCheck contained r n s relaxed normal strict
102syn keyword fsOptionsConv contained b t a binary text auto
103syn keyword fsOptionsFatType contained 12 16 32
104syn keyword fsOptionsKeywords contained quiet sys_immutable showexec dots nodots
105
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000106" Options: hfs
107syn match fsOptionsKeywords contained /\<\%(creator|type\)=/ nextgroup=fsOptionsString
108syn match fsOptionsKeywords contained /\<\%(dir\|file\|\)_umask=/ nextgroup=fsOptionsNumberOctal
109syn match fsOptionsKeywords contained /\<\%(session\|part\)=/ nextgroup=fsOptionsNumber
110
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +0000111" Options: ffs
112syn keyword fsOptionsKeyWords contained softdep
113
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114" Options: hpfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000115syn match fsOptionsKeywords contained /\<case=/ nextgroup=fsOptionsHpfsCase
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116syn keyword fsOptionsHpfsCase contained lower asis
117
118" Options: iso9660
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000119syn match fsOptionsKeywords contained /\<map=/ nextgroup=fsOptionsIsoMap
120syn match fsOptionsKeywords contained /\<block=/ nextgroup=fsOptionsSize
121syn match fsOptionsKeywords contained /\<\%(session\|sbsector\)=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000122syn keyword fsOptionsIsoMap contained n o a normal off acorn
123syn keyword fsOptionsKeywords contained norock nojoilet unhide cruft
124syn keyword fsOptionsConv contained m mtext
125
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000126" Options: jfs
127syn keyword fsOptionsKeywords nointegrity integrity
128
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129" Options: nfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000130syn 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 +0000131syn 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
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000134syn match fsOptionsKeywords contained /\<\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000135syn keyword fsOptionsKeywords contained utf8
136
137" Options: proc
138" -- everything already defined
139
140" Options: reiserfs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000141syn match fsOptionsKeywords contained /\<hash=/ nextgroup=fsOptionsReiserHash
142syn match fsOptionsKeywords contained /\<resize=/ nextgroup=fsOptionsNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000143syn keyword fsOptionsReiserHash contained rupasov tea r5 detect
144syn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly
145
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000146" Options: subfs
147syn match fsOptionsKeywords contained /\<fs=/ nextgroup=fsOptionsString
148syn keyword fsOptionsKeywords contained procuid
149
150" Options: swap
151syn match fsOptionsKeywords contained /\<pri=/ nextgroup=fsOptionsNumber
152
153" Options: tmpfs
154syn match fsOptionsKeywords contained /\<nr_\%(blocks\|inodes\)=/ nextgroup=fsOptionsNumber
155
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156" Options: udf
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000157syn match fsOptionsKeywords contained /\<\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsString
Bram Moolenaar071d4272004-06-13 20:20:40 +0000158syn keyword fsOptionsKeywords contained unhide undelete strict novrs
159
160" Options: ufs
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000161syn match fsOptionsKeywords contained /\<ufstype=/ nextgroup=fsOptionsUfsType
162syn match fsOptionsKeywords contained /\<onerror=/ nextgroup=fsOptionsUfsError
163syn keyword fsOptionsUfsType contained old hp 44bsd sun sunx86 nextstep openstep
164syn match fsOptionsUfsType contained /\<nextstep-cd\>/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000165syn keyword fsOptionsUfsError contained panic lock umount repair
166
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000167" Options: usbfs
168syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)\%(id\|gid\)=/ nextgroup=fsOptionsNumber
169syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)mode=/ nextgroup=fsOptionsNumberOctal
170
Bram Moolenaar071d4272004-06-13 20:20:40 +0000171" Options: vfat
172syn keyword fsOptionsKeywords contained nonumtail posix utf8
173syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortname
174syn keyword fsOptionsVfatShortname contained lower win95 winnt mixed
175
176" Options: xfs
177syn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000178syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce
Bram Moolenaar071d4272004-06-13 20:20:40 +0000179
180" Frequency / Pass No.
181syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassError
182syn match fsFreqPassError /\s\+\zs\%(\D.*\|\S.*\|\d\+\s\+[^012]\)\ze/ contained
183syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained
184
185" Groups
186syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster
187syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained
188syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained
189syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained
190syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained
191
192" Whole line comments
193syn match fsCommentLine /^#.*$/
194
195if 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
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +0000210 HiLink fsDeviceUUID String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000211 HiLink fsFreqPassNumber Number
212
Bram Moolenaardd2a3cd2007-05-05 17:10:09 +0000213 if exists('fstab_unknown_fs_errors') && fstab_unknown_fs_errors == 1
Bram Moolenaarb21e5842006-04-16 18:30:08 +0000214 HiLink fsTypeUnknown Error
215 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000216 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
244endif
245
246let b:current_syntax = "fstab"
247
248" vim: ts=8 ft=vim