Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: group(5) user group file |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 3 | " Maintainer: Nikolai Weibull <now@bitwi.se> |
Bram Moolenaar | 9b45125 | 2012-08-15 17:43:31 +0200 | [diff] [blame] | 4 | " Latest Revision: 2012-08-05 |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 5 | |
| 6 | if exists("b:current_syntax") |
| 7 | finish |
| 8 | endif |
| 9 | |
| 10 | let s:cpo_save = &cpo |
| 11 | set cpo&vim |
| 12 | |
| 13 | syn match groupBegin display '^' nextgroup=groupName |
| 14 | |
Bram Moolenaar | 9b45125 | 2012-08-15 17:43:31 +0200 | [diff] [blame] | 15 | syn match groupName contained display '[^:]\+' |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 16 | \ nextgroup=groupPasswordColon |
| 17 | |
| 18 | syn match groupPasswordColon contained display ':' |
| 19 | \ nextgroup=groupPassword,groupShadow |
| 20 | |
| 21 | syn match groupPassword contained display '[^:]*' |
| 22 | \ nextgroup=groupGIDColon |
| 23 | |
| 24 | syn match groupShadow contained display '[x*]' nextgroup=groupGIDColon |
| 25 | |
| 26 | syn match groupGIDColon contained display ':' nextgroup=groupGID |
| 27 | |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 28 | syn match groupGID contained display '\d*' |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 29 | \ nextgroup=groupUserListColon |
| 30 | |
| 31 | syn match groupUserListColon contained display ':' nextgroup=groupUserList |
| 32 | |
Bram Moolenaar | 9b45125 | 2012-08-15 17:43:31 +0200 | [diff] [blame] | 33 | syn match groupUserList contained '[^,]\+' |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 34 | \ nextgroup=groupUserListSep |
| 35 | |
| 36 | syn match groupUserListSep contained display ',' nextgroup=groupUserList |
| 37 | |
| 38 | hi def link groupDelimiter Normal |
| 39 | hi def link groupName Identifier |
| 40 | hi def link groupPasswordColon groupDelimiter |
| 41 | hi def link groupPassword Number |
| 42 | hi def link groupShadow Special |
| 43 | hi def link groupGIDColon groupDelimiter |
| 44 | hi def link groupGID Number |
| 45 | hi def link groupUserListColon groupDelimiter |
| 46 | hi def link groupUserList Identifier |
| 47 | hi def link groupUserListSep groupDelimiter |
| 48 | |
| 49 | let b:current_syntax = "group" |
| 50 | |
| 51 | let &cpo = s:cpo_save |
| 52 | unlet s:cpo_save |