248 lines · 10.9 KB · Text
RawDownload
" Vim syntax file" Language: fstab file" Maintaner: Radu Dineiu <radu.dineiu@gmail.com>" URL: http://ld.yi.org/vim/fstab.vim" Last Change: 2007 Apr 24" Version: 0.91"" Credits:"   David Necas (Yeti) <yeti@physics.muni.cz>"   Stefano Zacchiroli <zack@debian.org>"   Georgi Georgiev <chutz@gg3.net>"" Options:"   let fstab_unknown_fs_errors = 1"     highlight unknown filesystems as errors if version < 600	syntax clearelseif exists("b:current_syntax")	finishendif " Generalsyn cluster fsGeneralCluster contains=fsCommentsyn match fsComment /\s*#.*/syn match fsOperator /[,=:]/ " Devicesyn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceErrorsyn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ containedsyn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts sysfs usbfssyn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabelsyn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUIDsyn match fsDeviceKeyword contained /^[a-zA-Z0-9.\-]\+\ze:/syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperatorsyn match fsDeviceUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator " Mount Pointsyn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointErrorsyn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@\.-]\|\s\+\zs\w\{-}\ze\s\)/ containedsyn keyword fsMountPointKeyword contained none swap " Typesyn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknownsyn match fsTypeUnknown /\s\+\zs\w\+/ containedsyn 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 " Options" -------" Options: Generalsyn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeUnknownsyn match fsOptionsNumber /\d\+/syn match fsOptionsNumberOctal /[0-8]\+/syn match fsOptionsString /[a-zA-Z0-9_-]\+/syn keyword fsOptionsYesNo yes nosyn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatChecksyn keyword fsOptionsSize 512 1024 2048syn 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 xxsyn match fsOptionsGeneral /_netdev/ " Options: adfssyn match fsOptionsKeywords contained /\<\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber " Options: affssyn match fsOptionsKeywords contained /\<\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumbersyn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsStringsyn match fsOptionsKeywords contained /\<bs=/ nextgroup=fsOptionsSizesyn keyword fsOptionsKeywords contained protect usemp verbose " Options: cd9660syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet " Options: devpts" -- everything already defined " Options: ext2syn match fsOptionsKeywords contained /\<check=*/ nextgroup=@fsOptionsCheckClustersyn match fsOptionsKeywords contained /\<errors=/ nextgroup=fsOptionsExt2Errorssyn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumbersyn keyword fsOptionsExt2Check contained none normal strictsyn keyword fsOptionsExt2Errors contained continue panicsyn match fsOptionsExt2Errors contained /\<remount-ro\>/syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf noacl nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr " Options: ext3syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journalsyn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Datasyn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumbersyn keyword fsOptionsExt3Journal contained update inumsyn keyword fsOptionsExt3Data contained journal ordered writebacksyn keyword fsOptionsKeywords contained noload " Options: fatsyn match fsOptionsKeywords contained /\<blocksize=/ nextgroup=fsOptionsSizesyn match fsOptionsKeywords contained /\<\%([dfu]mask\|codepage\)=/ nextgroup=fsOptionsNumberOctalsyn match fsOptionsKeywords contained /\%(cvf_\%(format\|option\)\|iocharset\)=/ nextgroup=fsOptionsStringsyn match fsOptionsKeywords contained /\<check=/ nextgroup=@fsOptionsCheckClustersyn match fsOptionsKeywords contained /\<conv=*/ nextgroup=fsOptionsConvsyn match fsOptionsKeywords contained /\<fat=/ nextgroup=fsOptionsFatTypesyn match fsOptionsKeywords contained /\<dotsOK=/ nextgroup=fsOptionsYesNosyn keyword fsOptionsFatCheck contained r n s relaxed normal strictsyn keyword fsOptionsConv contained b t a binary text autosyn keyword fsOptionsFatType contained 12 16 32syn keyword fsOptionsKeywords contained quiet sys_immutable showexec dots nodots " Options: hfssyn match fsOptionsKeywords contained /\<\%(creator|type\)=/ nextgroup=fsOptionsStringsyn match fsOptionsKeywords contained /\<\%(dir\|file\|\)_umask=/ nextgroup=fsOptionsNumberOctalsyn match fsOptionsKeywords contained /\<\%(session\|part\)=/ nextgroup=fsOptionsNumber " Options: ffssyn keyword fsOptionsKeyWords contained softdep " Options: hpfssyn match fsOptionsKeywords contained /\<case=/ nextgroup=fsOptionsHpfsCasesyn keyword fsOptionsHpfsCase contained lower asis " Options: iso9660syn match fsOptionsKeywords contained /\<map=/ nextgroup=fsOptionsIsoMapsyn match fsOptionsKeywords contained /\<block=/ nextgroup=fsOptionsSizesyn match fsOptionsKeywords contained /\<\%(session\|sbsector\)=/ nextgroup=fsOptionsNumbersyn keyword fsOptionsIsoMap contained n o a normal off acornsyn keyword fsOptionsKeywords contained norock nojoilet unhide cruftsyn keyword fsOptionsConv contained m mtext " Options: jfssyn keyword fsOptionsKeywords nointegrity integrity " Options: nfssyn match fsOptionsKeywords contained /\<\%(rsize\|wsize\|timeo\|retrans\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mounthost\|mountprog\|mountvers\|nfsprog\|nfsvers\|namelen\)=/ nextgroup=fsOptionsStringsyn keyword fsOptionsKeywords contained bg fg soft hard intr cto ac tcp udp lock nobg nofg nosoft nohard nointr noposix nocto noac notcp noudp nolock " Options: ntfssyn match fsOptionsKeywords contained /\<\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumbersyn keyword fsOptionsKeywords contained utf8 " Options: proc" -- everything already defined " Options: reiserfssyn match fsOptionsKeywords contained /\<hash=/ nextgroup=fsOptionsReiserHashsyn match fsOptionsKeywords contained /\<resize=/ nextgroup=fsOptionsNumbersyn keyword fsOptionsReiserHash contained rupasov tea r5 detectsyn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly " Options: subfssyn match fsOptionsKeywords contained /\<fs=/ nextgroup=fsOptionsStringsyn keyword fsOptionsKeywords contained procuid " Options: swapsyn match fsOptionsKeywords contained /\<pri=/ nextgroup=fsOptionsNumber " Options: tmpfssyn match fsOptionsKeywords contained /\<nr_\%(blocks\|inodes\)=/ nextgroup=fsOptionsNumber " Options: udfsyn match fsOptionsKeywords contained /\<\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsStringsyn keyword fsOptionsKeywords contained unhide undelete strict novrs " Options: ufssyn match fsOptionsKeywords contained /\<ufstype=/ nextgroup=fsOptionsUfsTypesyn match fsOptionsKeywords contained /\<onerror=/ nextgroup=fsOptionsUfsErrorsyn keyword fsOptionsUfsType contained old hp 44bsd sun sunx86 nextstep openstepsyn match fsOptionsUfsType contained /\<nextstep-cd\>/syn keyword fsOptionsUfsError contained panic lock umount repair " Options: usbfssyn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)\%(id\|gid\)=/ nextgroup=fsOptionsNumbersyn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)mode=/ nextgroup=fsOptionsNumberOctal " Options: vfatsyn keyword fsOptionsKeywords contained nonumtail posix utf8syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortnamesyn keyword fsOptionsVfatShortname contained lower win95 winnt mixed " Options: xfssyn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsStringsyn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce " Frequency / Pass No.syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassErrorsyn match fsFreqPassError /\s\+\zs\%(\D.*\|\S.*\|\d\+\s\+[^012]\)\ze/ containedsyn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained " Groupssyn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralClustersyn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster containedsyn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster containedsyn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster containedsyn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained " Whole line commentssyn match fsCommentLine /^#.*$/ if version >= 508 || !exists("did_config_syntax_inits")	if version < 508		let did_config_syntax_inits = 1		command! -nargs=+ HiLink hi link <args>	else		command! -nargs=+ HiLink hi def link <args>	endif 	HiLink fsOperator Operator	HiLink fsComment Comment	HiLink fsCommentLine Comment 	HiLink fsTypeKeyword Type	HiLink fsDeviceKeyword Identifier	HiLink fsDeviceLabel String	HiLink fsDeviceUUID String	HiLink fsFreqPassNumber Number 	if exists('fstab_unknown_fs_errors') && fstab_unknown_fs_errors == 1		HiLink fsTypeUnknown Error	endif	HiLink fsDeviceError Error	HiLink fsMountPointError Error	HiLink fsMountPointKeyword Keyword	HiLink fsFreqPassError Error 	HiLink fsOptionsGeneral Type	HiLink fsOptionsKeywords Keyword	HiLink fsOptionsNumber Number	HiLink fsOptionsNumberOctal Number	HiLink fsOptionsString String	HiLink fsOptionsSize Number	HiLink fsOptionsExt2Check String	HiLink fsOptionsExt2Errors String	HiLink fsOptionsExt3Journal String	HiLink fsOptionsExt3Data String	HiLink fsOptionsFatCheck String	HiLink fsOptionsConv String	HiLink fsOptionsFatType Number	HiLink fsOptionsYesNo String	HiLink fsOptionsHpfsCase String	HiLink fsOptionsIsoMap String	HiLink fsOptionsReiserHash String	HiLink fsOptionsUfsType String	HiLink fsOptionsUfsError String 	HiLink fsOptionsVfatShortname String 	delcommand HiLinkendif let b:current_syntax = "fstab" " vim: ts=8 ft=vim