2006-03-28 21:08:56 +00:00
|
|
|
" Vim syntax file
|
2008-07-13 17:41:49 +00:00
|
|
|
" Language: Debian sources.list
|
2018-02-09 22:00:53 +01:00
|
|
|
" Maintainer: Debian Vim Maintainers
|
2008-07-13 17:41:49 +00:00
|
|
|
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
2024-02-27 01:34:45 -05:00
|
|
|
" Last Change: 2024 Jan 30
|
2023-02-02 13:59:48 +00:00
|
|
|
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim
|
2006-03-28 21:08:56 +00:00
|
|
|
|
|
|
|
" Standard syntax initialization
|
2018-05-06 17:57:30 +02:00
|
|
|
if exists('b:current_syntax')
|
2006-03-28 21:08:56 +00:00
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
" case sensitive
|
|
|
|
syn case match
|
|
|
|
|
|
|
|
" A bunch of useful keywords
|
2024-02-27 01:34:45 -05:00
|
|
|
syn match debsourcesType /\<\(deb-src\|deb\)\>/ contained
|
|
|
|
syn match debsourcesFreeComponent /\<\(main\|universe\)\>/ contained
|
|
|
|
syn match debsourcesNonFreeComponent /\<\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)\>/ contained
|
2006-03-28 21:08:56 +00:00
|
|
|
|
|
|
|
" Match comments
|
2010-01-06 20:54:52 +01:00
|
|
|
syn match debsourcesComment /#.*/ contains=@Spell
|
2006-03-28 21:08:56 +00:00
|
|
|
|
2023-10-26 17:14:30 -04:00
|
|
|
" Include Debian versioning information
|
|
|
|
runtime! syntax/shared/debversions.vim
|
|
|
|
|
|
|
|
exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedSupportedVersions, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
|
|
|
|
exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedUnsupportedVersions, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
|
|
|
|
|
|
|
|
unlet g:debSharedSupportedVersions
|
|
|
|
unlet g:debSharedUnsupportedVersions
|
2015-06-09 19:44:55 +02:00
|
|
|
|
2006-03-28 21:08:56 +00:00
|
|
|
" Match uri's
|
2018-05-06 17:57:30 +02:00
|
|
|
syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
|
2023-10-26 17:14:30 -04:00
|
|
|
syn region debsourcesLine start="^" end="$" contains=debsourcesType,debsourcesFreeComponent,debsourcesNonFreeComponent,debsourcesComment,debsourcesUri,debsourcesDistrKeyword,debsourcesUnsupportedDistrKeyword oneline
|
|
|
|
|
2006-03-28 21:08:56 +00:00
|
|
|
" Associate our matches and regions with pretty colours
|
2023-02-20 20:44:55 +00:00
|
|
|
hi def link debsourcesType Statement
|
|
|
|
hi def link debsourcesFreeComponent Statement
|
|
|
|
hi def link debsourcesNonFreeComponent Statement
|
2015-06-09 19:44:55 +02:00
|
|
|
hi def link debsourcesComment Comment
|
|
|
|
hi def link debsourcesUri Constant
|
2023-10-26 17:14:30 -04:00
|
|
|
hi def link debsourcesDistrKeyword Type
|
|
|
|
hi def link debsourcesUnsupportedDistrKeyword WarningMsg
|
2006-03-28 21:08:56 +00:00
|
|
|
|
2018-05-06 17:57:30 +02:00
|
|
|
let b:current_syntax = 'debsources'
|