asteriskvm.vim 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. syn sync clear
  13. syn sync fromstart
  14. syn keyword asteriskvmTodo TODO contained
  15. syn match asteriskvmComment ";.*" contains=asteriskvmTodo
  16. syn match asteriskvmContext "\[.\{-}\]"
  17. " ZoneMessages
  18. syn match asteriskvmZone "^[[:alnum:]]\+\s*=>\?\s*[[:alnum:]/_]\+|.*$" contains=zoneName,zoneDef
  19. syn match zoneName "=\zs[[:alnum:]/_]\+\ze" contained
  20. syn match zoneDef "|\zs.*\ze$" contained
  21. syn match asteriskvmSetting "\<\(format\|serveremail\|minmessage\|maxmessage\|maxgreet\|skipms\|maxsilence\|silencethreshold\|maxlogins\)="
  22. syn match asteriskvmSetting "\<\(externnotify\|externpass\|directoryintro\|charset\|adsi\(fdn\|sec\|ver\)\|\(pager\)\?fromstring\|email\(subject\|body\|cmd\)\|tz\|cidinternalcontexts\|saydurationm\|dialout\|callback\)="
  23. syn match asteriskvmSettingBool "\<\(attach\|pbxskip\|usedirectory\|saycid\|sayduration\|sendvoicemail\|review\|operator\|envelope\|delete\|nextaftercmd\|forcename\|forcegreeting\)=\(yes\|no\|1\|0\|true\|false\|t\|f\)"
  24. " Individual mailbox definitions
  25. syn match asteriskvmMailbox "^[[:digit:]]\+\s*=>\?\s*[[:digit:]]\+\(,[^,]*\(,[^,]*\(,[^,]*\(,[^,]*\)\?\)\?\)\?\)\?" contains=mailboxEmail,asteriskvmSetting,asteriskvmSettingBool,comma
  26. syn match mailboxEmail ",\zs[^@=,]*@[[:alnum:]\-\.]\+\.[[:alpha:]]\{2,10}\ze" contains=comma
  27. syn match comma "[,|]" contained
  28. " Define the default highlighting.
  29. " For version 5.7 and earlier: only when not done already
  30. " For version 5.8 and later: only when an item doesn't have highlighting yet
  31. :if version >= 508 || !exists("did_conf_syntax_inits")
  32. if version < 508
  33. let did_conf_syntax_inits = 1
  34. command -nargs=+ HiLink hi link <args>
  35. else
  36. command -nargs=+ HiLink hi def link <args>
  37. endif
  38. HiLink asteriskvmComment Comment
  39. HiLink asteriskvmContext Identifier
  40. HiLink asteriskvmZone Type
  41. HiLink zoneName String
  42. HiLink zoneDef String
  43. HiLink asteriskvmSetting Type
  44. HiLink asteriskvmSettingBool Type
  45. HiLink asteriskvmMailbox Statement
  46. HiLink mailboxEmail String
  47. delcommand HiLink
  48. endif
  49. let b:current_syntax = "asteriskvm"
  50. " vim: ts=8 sw=2