xref: /vim-8.2.3635/runtime/syntax/fstab.vim (revision 044b68f4)
1" Vim syntax file
2" Language: fstab file
3" Maintaner: Radu Dineiu <[email protected]>
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) <[email protected]>
10"   Stefano Zacchiroli <[email protected]>
11"   Georgi Georgiev <[email protected]>
12"
13" Options:
14"   let fstab_unknown_fs_errors = 1
15"     highlight unknown filesystems as errors
16
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*#.*/
26syn match fsOperator /[,=:]/
27
28" Device
29syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError
30syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained
31syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts sysfs usbfs
32syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel
33syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID
34syn match fsDeviceKeyword contained /^[a-zA-Z0-9.\-]\+\ze:/
35syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator
36syn match fsDeviceUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator
37
38" Mount Point
39syn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointError
40syn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@\.-]\|\s\+\zs\w\{-}\ze\s\)/ contained
41syn keyword fsMountPointKeyword contained none swap
42
43" Type
44syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown
45syn match fsTypeUnknown /\s\+\zs\w\+/ contained
46syn 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
51syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeUnknown
52syn 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
58syn 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
59syn match fsOptionsGeneral /_netdev/
60
61" Options: adfs
62syn match fsOptionsKeywords contained /\<\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber
63
64" Options: affs
65syn 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
68syn 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
77syn match fsOptionsKeywords contained /\<check=*/ nextgroup=@fsOptionsCheckCluster
78syn match fsOptionsKeywords contained /\<errors=/ nextgroup=fsOptionsExt2Errors
79syn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumber
80syn keyword fsOptionsExt2Check contained none normal strict
81syn keyword fsOptionsExt2Errors contained continue panic
82syn 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
84
85" Options: ext3
86syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journal
87syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Data
88syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber
89syn keyword fsOptionsExt3Journal contained update inum
90syn keyword fsOptionsExt3Data contained journal ordered writeback
91syn keyword fsOptionsKeywords contained noload
92
93" Options: fat
94syn match fsOptionsKeywords contained /\<blocksize=/ nextgroup=fsOptionsSize
95syn match fsOptionsKeywords contained /\<\%([dfu]mask\|codepage\)=/ nextgroup=fsOptionsNumberOctal
96syn match fsOptionsKeywords contained /\%(cvf_\%(format\|option\)\|iocharset\)=/ nextgroup=fsOptionsString
97syn 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
101syn 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
106" 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
111" Options: ffs
112syn keyword fsOptionsKeyWords contained softdep
113
114" Options: hpfs
115syn match fsOptionsKeywords contained /\<case=/ nextgroup=fsOptionsHpfsCase
116syn keyword fsOptionsHpfsCase contained lower asis
117
118" Options: iso9660
119syn match fsOptionsKeywords contained /\<map=/ nextgroup=fsOptionsIsoMap
120syn match fsOptionsKeywords contained /\<block=/ nextgroup=fsOptionsSize
121syn match fsOptionsKeywords contained /\<\%(session\|sbsector\)=/ nextgroup=fsOptionsNumber
122syn keyword fsOptionsIsoMap contained n o a normal off acorn
123syn keyword fsOptionsKeywords contained norock nojoilet unhide cruft
124syn keyword fsOptionsConv contained m mtext
125
126" Options: jfs
127syn keyword fsOptionsKeywords nointegrity integrity
128
129" Options: nfs
130syn match fsOptionsKeywords contained /\<\%(rsize\|wsize\|timeo\|retrans\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mounthost\|mountprog\|mountvers\|nfsprog\|nfsvers\|namelen\)=/ nextgroup=fsOptionsString
131syn 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
134syn match fsOptionsKeywords contained /\<\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumber
135syn keyword fsOptionsKeywords contained utf8
136
137" Options: proc
138" -- everything already defined
139
140" Options: reiserfs
141syn match fsOptionsKeywords contained /\<hash=/ nextgroup=fsOptionsReiserHash
142syn match fsOptionsKeywords contained /\<resize=/ nextgroup=fsOptionsNumber
143syn keyword fsOptionsReiserHash contained rupasov tea r5 detect
144syn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly
145
146" 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
156" Options: udf
157syn match fsOptionsKeywords contained /\<\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsString
158syn keyword fsOptionsKeywords contained unhide undelete strict novrs
159
160" Options: ufs
161syn 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\>/
165syn keyword fsOptionsUfsError contained panic lock umount repair
166
167" Options: usbfs
168syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)\%(id\|gid\)=/ nextgroup=fsOptionsNumber
169syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)mode=/ nextgroup=fsOptionsNumberOctal
170
171" 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
178syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce
179
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
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
244endif
245
246let b:current_syntax = "fstab"
247
248" vim: ts=8 ft=vim
249