1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-23 02:05:11 +01:00
vim/runtime/syntax/debsources.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
2 KiB
VimL
Raw Permalink Normal View History

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>
" 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
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
" 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\):\)[^' <>"]\+'
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
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'