group.vim 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. " Vim syntax file
  2. " Language: group(5) user group file
  3. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision: 2012-08-05
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. let s:cpo_save = &cpo
  9. set cpo&vim
  10. syn match groupBegin display '^' nextgroup=groupName
  11. syn match groupName contained display '[^:]\+'
  12. \ nextgroup=groupPasswordColon
  13. syn match groupPasswordColon contained display ':'
  14. \ nextgroup=groupPassword,groupShadow
  15. syn match groupPassword contained display '[^:]*'
  16. \ nextgroup=groupGIDColon
  17. syn match groupShadow contained display '[x*]' nextgroup=groupGIDColon
  18. syn match groupGIDColon contained display ':' nextgroup=groupGID
  19. syn match groupGID contained display '\d*'
  20. \ nextgroup=groupUserListColon
  21. syn match groupUserListColon contained display ':' nextgroup=groupUserList
  22. syn match groupUserList contained '[^,]\+'
  23. \ nextgroup=groupUserListSep
  24. syn match groupUserListSep contained display ',' nextgroup=groupUserList
  25. hi def link groupDelimiter Normal
  26. hi def link groupName Identifier
  27. hi def link groupPasswordColon groupDelimiter
  28. hi def link groupPassword Number
  29. hi def link groupShadow Special
  30. hi def link groupGIDColon groupDelimiter
  31. hi def link groupGID Number
  32. hi def link groupUserListColon groupDelimiter
  33. hi def link groupUserList Identifier
  34. hi def link groupUserListSep groupDelimiter
  35. let b:current_syntax = "group"
  36. let &cpo = s:cpo_save
  37. unlet s:cpo_save