[svn-commits] tilghman: trunk r180304 - /trunk/contrib/editors/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Mar 4 19:41:40 CST 2009
Author: tilghman
Date: Wed Mar 4 19:41:37 2009
New Revision: 180304
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=180304
Log:
Add syntax coloring files for Vim, including a new one for AEL
Added:
trunk/contrib/editors/
trunk/contrib/editors/ael.vim (with props)
trunk/contrib/editors/asterisk.vim (with props)
trunk/contrib/editors/asteriskvm.vim (with props)
Added: trunk/contrib/editors/ael.vim
URL: http://svn.digium.com/svn-view/asterisk/trunk/contrib/editors/ael.vim?view=auto&rev=180304
==============================================================================
--- trunk/contrib/editors/ael.vim (added)
+++ trunk/contrib/editors/ael.vim Wed Mar 4 19:41:37 2009
@@ -1,0 +1,69 @@
+" Vim syntax file
+" Language: Asterisk Extension Language
+" Maintainer: tilghman
+" Last Change: 2009 Mar 04
+" version 0.1
+"
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn sync clear
+syn sync fromstart
+
+syn keyword aelTodo TODO contained
+syn keyword aelKeyword context includes macro globals if else switch case default catch return switches includes for ignorepat
+syn match aelComment "//.*" contains=aelTodo
+syn match aelContext "\s+\zs[[:alpha:]][[:alnum:]\-_]*\ze\s*{"
+" Macro declaration
+syn match aelMacro "[[:alpha:]][[:alnum:]\-_]*(.\{-})\ze\s*{" contains=aelVar,aelFunction,aelExp,aelArgs
+" Macro reference
+syn match aelMacro "&[[:alpha:]][[:alnum:]\-_]*(.\{-});" contains=aelVar,aelFunction,aelExp,aelArgs
+" Ranges or other pattern characters
+syn match aelExten "\zs_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*\-]\)\+[\.!]\?\ze\s+=>"
+syn match aelExten "\zs[[:alnum:]#*]\+\ze\s*=>"
+syn match aelApp "\s\+\zs[[:alpha:]][[:alpha:]_]\+\ze[; ]"
+syn match aelApp "\s\+\zs[[:alpha:]][[:alpha:]_]\+\ze(.\{-});"
+syn match aelLabel "[[:alpha:]][[:alnum:]]*\ze:"
+syn region aelVar matchgroup=aelVarStart start="\${" end="}" contains=aelVar,aelFunction,aelExp
+syn match aelVar "\zs[[:alpha:]][[:alnum:]_]*\ze=" contains=aelVar,aelFunction,aelExp
+" Retrieving the value of a function
+syn match aelFunction "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.\{-})}" contains=aelVar,aelFunction,aelExp
+" Setting a function
+syn match aelFunction "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=aelVar,aelFunction,aelExp
+syn region aelExp matchgroup=aelExpStart start="\$\[" end="]" contains=aelVar,aelFunction,aelExp
+syn match aelArgs "([[:alnum:]_, ]*)" contains=aelArgsElement contained
+syn match aelArgsElement "[[:alpha:]][[:alnum:]_]*" contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_conf_syntax_inits")
+ if version < 508
+ let did_conf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink aelComment Comment
+ HiLink aelContext Preproc
+ HiLink aelMacro Preproc
+ HiLink aelExten Type
+ HiLink aelLabel Type
+ HiLink aelApp Preproc
+ HiLink aelVar String
+ HiLink aelVarStart String
+ HiLink aelArgsElement String
+ HiLink aelFunction Function
+ HiLink aelExp Type
+ HiLink aelExpStart Type
+ HiLink aelKeyword Statement
+ HiLink aelError Error
+ delcommand HiLink
+endif
+let b:current_syntax = "ael"
+" vim: ts=8 sw=2
+
Propchange: trunk/contrib/editors/ael.vim
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/contrib/editors/ael.vim
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: trunk/contrib/editors/ael.vim
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: trunk/contrib/editors/asterisk.vim
URL: http://svn.digium.com/svn-view/asterisk/trunk/contrib/editors/asterisk.vim?view=auto&rev=180304
==============================================================================
--- trunk/contrib/editors/asterisk.vim (added)
+++ trunk/contrib/editors/asterisk.vim Wed Mar 4 19:41:37 2009
@@ -1,0 +1,96 @@
+" Vim syntax file
+" Language: Asterisk config file
+" Maintainer: tilghman
+" Last Change: 2009 Mar 04
+" version 0.5
+"
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn sync clear
+syn sync fromstart
+
+syn keyword asteriskTodo TODO contained
+syn match asteriskComment ";.*" contains=asteriskTodo
+syn match asteriskContext "\[.\{-}\]"
+syn match asteriskExten "^\s*exten\s*=>\?\s*[^,]\+" contains=asteriskPattern
+syn match asteriskExten "^\s*\(register\|channel\|ignorepat\|include\|\(no\)\?load\)\s*=>\?"
+syn match asteriskPattern "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained
+syn match asteriskPattern "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained
+syn match asteriskApp ",\zs[a-zA-Z]\+\ze$"
+syn match asteriskApp ",\zs[a-zA-Z]\+\ze("
+" Digits plus oldlabel (newlabel)
+syn match asteriskPriority ",\zs[[:digit:]]\+\(+[[:alpha:]][[:alnum:]_]*\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
+" oldlabel plus digits (newlabel)
+syn match asteriskPriority ",\zs[[:alpha:]][[:alnum:]_]*+[[:digit:]]\+\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
+" s or n plus digits (newlabel)
+syn match asteriskPriority ",\zs[sn]\(+[[:digit:]]\+\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
+syn match asteriskLabel "(\zs[[:alpha:]][[:alnum:]]*\ze)" contained
+syn match asteriskError "^\s*#\s*[[:alnum:]]*"
+syn match asteriskInclude "^\s*#\s*\(include\|exec\)\s.*"
+syn region asteriskVar matchgroup=asteriskVarStart start="\${" end="}" contains=asteriskVar,asteriskFunction,asteriskExp
+syn match asteriskVar "\zs[[:alpha:]][[:alnum:]_]*\ze=" contains=asteriskVar,asteriskFunction,asteriskExp
+syn match asteriskFunction "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)}" contains=asteriskVar,asteriskFunction,asteriskExp
+syn match asteriskFunction "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskFunction,asteriskExp
+syn region asteriskExp matchgroup=asteriskExpStart start="\$\[" end="]" contains=asteriskVar,asteriskFunction,asteriskExp
+syn match asteriskCodecsPermit "^\s*\(allow\|disallow\)\s*=\s*.*$" contains=asteriskCodecs
+syn match asteriskCodecs "\(g723\|gsm\|ulaw\|alaw\|g726\|adpcm\|slin\|lpc10\|g729\|speex\|ilbc\|all\s*$\)"
+syn match asteriskError "^\(type\|auth\|permit\|deny\|bindaddr\|host\)\s*=.*$"
+syn match asteriskType "^\zstype=\ze\<\(peer\|user\|friend\)\>$" contains=asteriskTypeType
+syn match asteriskTypeType "\<\(peer\|user\|friend\)\>" contained
+syn match asteriskAuth "^\zsauth\s*=\ze\s*\<\(md5\|rsa\|plaintext\)\>$" contains=asteriskAuthType
+syn match asteriskAuthType "\<\(md5\|rsa\|plaintext\)\>" contained
+syn match asteriskAuth "^\zs\(secret\|inkeys\|outkey\)\s*=\ze.*$"
+syn match asteriskAuth "^\(permit\|deny\)\s*=\s*\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/\d\{1,3}\(\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\?\s*$" contains=asteriskIPRange
+syn match asteriskIPRange "\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}" contained
+syn match asteriskIP "\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}" contained
+syn match asteriskHostname "\([[:alnum:]\-]*\.\)\+[[:alpha:]]\{2,10}" contained
+syn match asteriskPort "\d\{1,5}" contained
+syn match asteriskSetting "^\(tcp\|tls\)\?bindaddr\s*=\s*\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}$" contains=asteriskIP
+syn match asteriskError "port\s*=.*$"
+syn match asteriskSetting "^\(bind\)\?port\s*=\s*\d\{1,5}\s*$" contains=asteriskPort
+syn match asteriskSetting "^host\s*=\s*\(dynamic\|\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\|\([[:alnum:]\-]*\.\)\+[[:alpha:]]\{2,10}\)" contains=asteriskIP,asteriskHostname
+syn match asteriskError "[[:space:]]$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_conf_syntax_inits")
+ if version < 508
+ let did_conf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink asteriskComment Comment
+ HiLink asteriskExten String
+ HiLink asteriskContext Preproc
+ HiLink asteriskPattern Type
+ HiLink asteriskApp Statement
+ HiLink asteriskInclude Preproc
+ HiLink asteriskPriority Preproc
+ HiLink asteriskLabel Type
+ HiLink asteriskVar String
+ HiLink asteriskFunction Function
+ HiLink asteriskExp Type
+ HiLink asteriskCodecsPermit Preproc
+ HiLink asteriskCodecs String
+ HiLink asteriskType Statement
+ HiLink asteriskTypeType Type
+ HiLink asteriskAuth String
+ HiLink asteriskAuthType Type
+ HiLink asteriskIPRange Identifier
+ HiLink asteriskIP Identifier
+ HiLink asteriskPort Identifier
+ HiLink asteriskHostname Identifier
+ HiLink asteriskSetting Statement
+ HiLink asteriskError Error
+ delcommand HiLink
+endif
+let b:current_syntax = "asterisk"
+" vim: ts=8 sw=2
+
Propchange: trunk/contrib/editors/asterisk.vim
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/contrib/editors/asterisk.vim
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: trunk/contrib/editors/asterisk.vim
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: trunk/contrib/editors/asteriskvm.vim
URL: http://svn.digium.com/svn-view/asterisk/trunk/contrib/editors/asteriskvm.vim?view=auto&rev=180304
==============================================================================
--- trunk/contrib/editors/asteriskvm.vim (added)
+++ trunk/contrib/editors/asteriskvm.vim Wed Mar 4 19:41:37 2009
@@ -1,0 +1,62 @@
+" Vim syntax file
+" Language: Asterisk voicemail config file
+" Maintainer: Tilghman Lesher (Corydon76)
+" Last Change: 2006 Mar 21
+" version 0.2
+"
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn sync clear
+syn sync fromstart
+
+
+syn keyword asteriskvmTodo TODO contained
+syn match asteriskvmComment ";.*" contains=asteriskvmTodo
+syn match asteriskvmContext "\[.\{-}\]"
+
+" ZoneMessages
+syn match asteriskvmZone "^[[:alnum:]]\+\s*=>\?\s*[[:alnum:]/_]\+|.*$" contains=zoneName,zoneDef
+syn match zoneName "=\zs[[:alnum:]/_]\+\ze" contained
+syn match zoneDef "|\zs.*\ze$" contained
+
+syn match asteriskvmSetting "\<\(format\|serveremail\|minmessage\|maxmessage\|maxgreet\|skipms\|maxsilence\|silencethreshold\|maxlogins\)="
+syn match asteriskvmSetting "\<\(externnotify\|externpass\|directoryintro\|charset\|adsi\(fdn\|sec\|ver\)\|\(pager\)\?fromstring\|email\(subject\|body\|cmd\)\|tz\|cidinternalcontexts\|saydurationm\|dialout\|callback\)="
+syn match asteriskvmSettingBool "\<\(attach\|pbxskip\|usedirectory\|saycid\|sayduration\|sendvoicemail\|review\|operator\|envelope\|delete\|nextaftercmd\|forcename\|forcegreeting\)=\(yes\|no\|1\|0\|true\|false\|t\|f\)"
+
+" Individual mailbox definitions
+syn match asteriskvmMailbox "^[[:digit:]]\+\s*=>\?\s*[[:digit:]]\+\(,[^,]*\(,[^,]*\(,[^,]*\(,[^,]*\)\?\)\?\)\?\)\?" contains=mailboxEmail,asteriskvmSetting,asteriskvmSettingBool,comma
+syn match mailboxEmail ",\zs[^@=,]*@[[:alnum:]\-\.]\+\.[[:alpha:]]\{2,10}\ze" contains=comma
+syn match comma "[,|]" contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+:if version >= 508 || !exists("did_conf_syntax_inits")
+ if version < 508
+ let did_conf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink asteriskvmComment Comment
+ HiLink asteriskvmContext Identifier
+ HiLink asteriskvmZone Type
+ HiLink zoneName String
+ HiLink zoneDef String
+ HiLink asteriskvmSetting Type
+ HiLink asteriskvmSettingBool Type
+
+ HiLink asteriskvmMailbox Statement
+ HiLink mailboxEmail String
+ delcommand HiLink
+endif
+
+let b:current_syntax = "asteriskvm"
+
+" vim: ts=8 sw=2
+
Propchange: trunk/contrib/editors/asteriskvm.vim
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/contrib/editors/asteriskvm.vim
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: trunk/contrib/editors/asteriskvm.vim
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the svn-commits
mailing list