debsources.vim 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: 2018 Aug 11
  6. " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim
  7. " Standard syntax initialization
  8. if exists('b:current_syntax')
  9. finish
  10. endif
  11. " case sensitive
  12. syn case match
  13. " A bunch of useful keywords
  14. syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
  15. " Match comments
  16. syn match debsourcesComment /#.*/ contains=@Spell
  17. let s:cpo = &cpo
  18. set cpo-=C
  19. let s:supported = [
  20. \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
  21. \ 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
  22. \
  23. \ 'trusty', 'xenial', 'bionic', 'cosmic', 'devel'
  24. \ ]
  25. let s:unsupported = [
  26. \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
  27. \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
  28. \
  29. \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
  30. \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
  31. \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
  32. \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful'
  33. \ ]
  34. let &cpo=s:cpo
  35. " Match uri's
  36. syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
  37. exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
  38. exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
  39. " Associate our matches and regions with pretty colours
  40. hi def link debsourcesLine Error
  41. hi def link debsourcesKeyword Statement
  42. hi def link debsourcesDistrKeyword Type
  43. hi def link debsourcesUnsupportedDistrKeyword WarningMsg
  44. hi def link debsourcesComment Comment
  45. hi def link debsourcesUri Constant
  46. let b:current_syntax = 'debsources'