Bram Moolenaar | eee697b | 2006-03-21 21:20:39 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Asterisk voicemail config file |
| 3 | " Maintainer: Tilghman Lesher (Corydon76) |
| 4 | " Last Change: 2006 Mar 21 |
| 5 | " version 0.2 |
| 6 | " |
| 7 | if version < 600 |
| 8 | syntax clear |
| 9 | elseif exists("b:current_syntax") |
| 10 | finish |
| 11 | endif |
| 12 | |
| 13 | syn sync clear |
| 14 | syn sync fromstart |
| 15 | |
| 16 | |
| 17 | syn keyword asteriskvmTodo TODO contained |
| 18 | syn match asteriskvmComment ";.*" contains=asteriskvmTodo |
| 19 | syn match asteriskvmContext "\[.\{-}\]" |
| 20 | |
| 21 | " ZoneMessages |
| 22 | syn match asteriskvmZone "^[[:alnum:]]\+\s*=>\?\s*[[:alnum:]/_]\+|.*$" contains=zoneName,zoneDef |
| 23 | syn match zoneName "=\zs[[:alnum:]/_]\+\ze" contained |
| 24 | syn match zoneDef "|\zs.*\ze$" contained |
| 25 | |
| 26 | syn match asteriskvmSetting "\<\(format\|serveremail\|minmessage\|maxmessage\|maxgreet\|skipms\|maxsilence\|silencethreshold\|maxlogins\)=" |
| 27 | syn match asteriskvmSetting "\<\(externnotify\|externpass\|directoryintro\|charset\|adsi\(fdn\|sec\|ver\)\|\(pager\)\?fromstring\|email\(subject\|body\|cmd\)\|tz\|cidinternalcontexts\|saydurationm\|dialout\|callback\)=" |
| 28 | syn match asteriskvmSettingBool "\<\(attach\|pbxskip\|usedirectory\|saycid\|sayduration\|sendvoicemail\|review\|operator\|envelope\|delete\|nextaftercmd\|forcename\|forcegreeting\)=\(yes\|no\|1\|0\|true\|false\|t\|f\)" |
| 29 | |
| 30 | " Individual mailbox definitions |
| 31 | syn match asteriskvmMailbox "^[[:digit:]]\+\s*=>\?\s*[[:digit:]]\+\(,[^,]*\(,[^,]*\(,[^,]*\(,[^,]*\)\?\)\?\)\?\)\?" contains=mailboxEmail,asteriskvmSetting,asteriskvmSettingBool,comma |
| 32 | syn match mailboxEmail ",\zs[^@=,]*@[[:alnum:]\-\.]\+\.[[:alpha:]]\{2,10}\ze" contains=comma |
| 33 | syn match comma "[,|]" contained |
| 34 | |
| 35 | " Define the default highlighting. |
| 36 | " For version 5.7 and earlier: only when not done already |
| 37 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 38 | :if version >= 508 || !exists("did_conf_syntax_inits") |
| 39 | if version < 508 |
| 40 | let did_conf_syntax_inits = 1 |
| 41 | command -nargs=+ HiLink hi link <args> |
| 42 | else |
| 43 | command -nargs=+ HiLink hi def link <args> |
| 44 | endif |
| 45 | |
| 46 | HiLink asteriskvmComment Comment |
| 47 | HiLink asteriskvmContext Identifier |
| 48 | HiLink asteriskvmZone Type |
| 49 | HiLink zoneName String |
| 50 | HiLink zoneDef String |
| 51 | HiLink asteriskvmSetting Type |
| 52 | HiLink asteriskvmSettingBool Type |
| 53 | |
| 54 | HiLink asteriskvmMailbox Statement |
| 55 | HiLink mailboxEmail String |
| 56 | delcommand HiLink |
| 57 | endif |
| 58 | |
| 59 | let b:current_syntax = "asteriskvm" |
| 60 | |
| 61 | " vim: ts=8 sw=2 |
| 62 | |