robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
1a7c38caec
master
1" Vim syntax file 2" Language: Debian sources.list 3" Maintainer: Debian Vim Maintainers 4" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> 5" Last Change: 2024 Jan 30 6" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim 7 8" Standard syntax initialization 9if exists ( 'b:current_syntax' ) 10finish 11endif 12 13" case sensitive 14syn case match 15 16" A bunch of useful keywords 17syn match debsourcesType /\<\(deb-src\|deb\)\> /contained 18syn match debsourcesFreeComponent /\<\(main\|universe\)\> /contained 19syn match debsourcesNonFreeComponent /\<\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)\> /contained 20 21" Match comments 22syn match debsourcesComment /#. * /contains = @Spell 23 24" Include Debian versioning information 25runtime ! syntax/shared/debversions.vim 26 27exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\(' . join ( g: debSharedSupportedVersions , '\|' ) . '\)\>\([-[:alnum:]_./]*\)+' 28exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\(' . join ( g: debSharedUnsupportedVersions , '\|' ) . '\)\>\([-[:alnum:]_./]*\)+' 29 30unlet g: debSharedSupportedVersions 31unlet g: debSharedUnsupportedVersions 32 33" Match uri's 34syn match debsourcesUri '\(https\?://\|ftp://\| [ rs ] sh://\|debtorrent://\|\(cdrom\|copy\|file\):\) [ ^' <>" ] \+ ' 35syn region debsourcesLine start = "^ "end = "$ "contains = debsourcesType , debsourcesFreeComponent , debsourcesNonFreeComponent , debsourcesComment , debsourcesUri , debsourcesDistrKeyword , debsourcesUnsupportedDistrKeyword oneline 36 37" Associate our matches and regions with pretty colours 38hi def link debsourcesType Statement 39hi def link debsourcesFreeComponent Statement 40hi def link debsourcesNonFreeComponent Statement 41hi def link debsourcesComment Comment 42hi def link debsourcesUri Constant 43hi def link debsourcesDistrKeyword Type 44hi def link debsourcesUnsupportedDistrKeyword WarningMsg 45 46let b: current_syntax = 'debsources'