trustees.vim 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. " Vim syntax file
  2. " Language: trustees
  3. " Maintainer: Nima Talebi <nima@it.net.au>
  4. " Last Change: 2022 Jun 14
  5. " quit when a syntax file was already loaded
  6. if exists("b:current_syntax")
  7. finish
  8. endif
  9. syntax case match
  10. syntax sync minlines=0 maxlines=0
  11. " Errors & Comments
  12. syntax match tfsError /.*/
  13. highlight link tfsError Error
  14. syntax keyword tfsSpecialComment TODO XXX FIXME contained
  15. highlight link tfsSpecialComment Todo
  16. syntax match tfsComment ~\s*#.*~ contains=tfsSpecialComment
  17. highlight link tfsComment Comment
  18. " Operators & Delimiters
  19. highlight link tfsSpecialChar Operator
  20. syntax match tfsSpecialChar ~[*!+]~ contained
  21. highlight link tfsDelimiter Delimiter
  22. syntax match tfsDelimiter ~:~ contained
  23. " Trustees Rules - Part 1 of 3 - The Device
  24. syntax region tfsRuleDevice matchgroup=tfsDeviceContainer start=~\[/~ end=~\]~ nextgroup=tfsRulePath oneline
  25. highlight link tfsRuleDevice Label
  26. highlight link tfsDeviceContainer PreProc
  27. " Trustees Rules - Part 2 of 3 - The Path
  28. syntax match tfsRulePath ~/[-_a-zA-Z0-9/]*~ nextgroup=tfsRuleACL contained contains=tfsDelimiter
  29. highlight link tfsRulePath String
  30. " Trustees Rules - Part 3 of 3 - The ACLs
  31. syntax match tfsRuleACL ~\(:\(\*\|[+]\{0,1\}[a-zA-Z0-9/]\+\):[RWEBXODCU!]\+\)\+$~ contained contains=tfsDelimiter,tfsRuleWho,tfsRuleWhat
  32. syntax match tfsRuleWho ~\(\*\|[+]\{0,1\}[a-zA-Z0-9/]\+\)~ contained contains=tfsSpecialChar
  33. highlight link tfsRuleWho Identifier
  34. syntax match tfsRuleWhat ~[RWEBXODCU!]\+~ contained contains=tfsSpecialChar
  35. highlight link tfsRuleWhat Structure
  36. let b:current_syntax = 'trustees'