From afce081b90c1e2c50c3507758c7558a0dfa1f33e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 15:18:03 +0200 Subject: Adding upstream version 2:8.2.2434. Signed-off-by: Daniel Baumann --- runtime/syntax/fstab.vim | 291 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 runtime/syntax/fstab.vim (limited to 'runtime/syntax/fstab.vim') diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim new file mode 100644 index 0000000..3184887 --- /dev/null +++ b/runtime/syntax/fstab.vim @@ -0,0 +1,291 @@ +" Vim syntax file +" Language: fstab file +" Maintainer: Radu Dineiu +" URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim +" Last Change: 2020 Dec 30 +" Version: 1.4 +" +" Credits: +" David Necas (Yeti) +" Stefano Zacchiroli +" Georgi Georgiev +" James Vega +" Elias Probst + +" Options: +" let fstab_unknown_fs_errors = 1 +" highlight unknown filesystems as errors +" +" let fstab_unknown_device_errors = 0 +" do not highlight unknown devices as errors + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" General +syn cluster fsGeneralCluster contains=fsComment +syn match fsComment /\s*#.*/ contains=@Spell +syn match fsOperator /[,=:#]/ + +" Device +syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError +syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained +syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts devtmpfs sysfs usbfs +syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel +syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID +syn keyword fsDeviceKeyword contained PARTLABEL nextgroup=fsDevicePARTLABEL +syn keyword fsDeviceKeyword contained PARTUUID nextgroup=fsDevicePARTUUID +syn keyword fsDeviceKeyword contained sshfs nextgroup=fsDeviceSshfs +syn match fsDeviceKeyword contained /^[a-zA-Z0-9.\-]\+\ze:/ +syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator +syn match fsDeviceUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator +syn match fsDevicePARTLABEL contained /=[^ \t]\+/hs=s+1 contains=fsOperator +syn match fsDevicePARTUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator +syn match fsDeviceSshfs contained /#[_=[:alnum:]\.\/+-]\+@[a-z0-9._-]\+\a\{2}:[^ \t]\+/hs=s+1 contains=fsOperator + +" Mount Point +syn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointError +syn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@\.-]\|\s\+\zs\w\{-}\ze\s\)/ contained +syn keyword fsMountPointKeyword contained none swap + +" Type +syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown +syn match fsTypeUnknown /\s\+\zs\w\+/ contained +syn keyword fsTypeKeyword contained adfs ados affs anon_inodefs atfs audiofs auto autofs bdev befs bfs btrfs binfmt_misc cd9660 cfs cgroup cifs coda configfs cpuset cramfs devfs devpts devtmpfs e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse fuseblk fusectl hfs hpfs hugetlbfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix mqueue msdos ncpfs nfs nfsd nilfs2 none ntfs null nwfs overlay ovlfs pipefs portal proc procfs pstore ptyfs qnx4 reiserfs ramfs romfs securityfs shm smbfs squashfs sockfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xenfs xfs zisofs + +" Options +" ------- +" Options: General +syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeUnknown +syn match fsOptionsNumber /\d\+/ +syn match fsOptionsNumberOctal /[0-8]\+/ +syn match fsOptionsString /[a-zA-Z0-9_-]\+/ +syn keyword fsOptionsYesNo yes no +syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck +syn keyword fsOptionsSize 512 1024 2048 +syn 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 norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail failok +syn match fsOptionsGeneral /_netdev/ + +" Options: adfs +syn match fsOptionsKeywords contained /\<\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber + +" Options: affs +syn match fsOptionsKeywords contained /\<\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumber +syn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsString +syn match fsOptionsKeywords contained /\/ +syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr + +" Options: ext3 +syn match fsOptionsKeywords contained /\/ +syn keyword fsOptionsUfsError contained panic lock umount repair + +" Options: usbfs +syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)\%(id\|gid\)=/ nextgroup=fsOptionsNumber +syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)mode=/ nextgroup=fsOptionsNumberOctal + +" Options: vfat +syn keyword fsOptionsKeywords contained nonumtail posix utf8 +syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortname +syn keyword fsOptionsVfatShortname contained lower win95 winnt mixed + +" Options: xfs +syn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString +syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce + +" Frequency / Pass No. +syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassError +syn match fsFreqPassError /\s\+\zs\%(\D.*\|\S.*\|\d\+\s\+[^012]\)\ze/ contained +syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained + +" Groups +syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster +syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained +syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained +syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained +syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained + +" Whole line comments +syn match fsCommentLine /^#.*$/ contains=@Spell + +hi def link fsOperator Operator +hi def link fsComment Comment +hi def link fsCommentLine Comment + +hi def link fsTypeKeyword Type +hi def link fsDeviceKeyword Identifier +hi def link fsDeviceLabel String +hi def link fsDeviceUUID String +hi def link fsDevicePARTLABEL String +hi def link fsDevicePARTUUID String +hi def link fsDeviceSshfs String +hi def link fsFreqPassNumber Number + +if exists('fstab_unknown_fs_errors') && fstab_unknown_fs_errors == 1 + hi def link fsTypeUnknown Error +endif + +if !exists('fstab_unknown_device_errors') || fstab_unknown_device_errors == 1 + hi def link fsDeviceError Error +endif + +hi def link fsMountPointError Error +hi def link fsMountPointKeyword Keyword +hi def link fsFreqPassError Error + +hi def link fsOptionsGeneral Type +hi def link fsOptionsKeywords Keyword +hi def link fsOptionsNumber Number +hi def link fsOptionsNumberOctal Number +hi def link fsOptionsString String +hi def link fsOptionsSize Number +hi def link fsOptionsExt2Check String +hi def link fsOptionsExt2Errors String +hi def link fsOptionsExt3Journal String +hi def link fsOptionsExt3Data String +hi def link fsOptionsExt4Journal String +hi def link fsOptionsExt4Data String +hi def link fsOptionsExt4Barrier Number +hi def link fsOptionsFatCheck String +hi def link fsOptionsConv String +hi def link fsOptionsFatType Number +hi def link fsOptionsYesNo String +hi def link fsOptionsHpfsCase String +hi def link fsOptionsIsoMap String +hi def link fsOptionsReiserHash String +hi def link fsOptionsSshYesNoAsk String +hi def link fsOptionsUfsType String +hi def link fsOptionsUfsError String + +hi def link fsOptionsVfatShortname String + +let b:current_syntax = "fstab" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8 ft=vim -- cgit v1.2.3