Asterisk AEL vim syntax

-- Asterisk AEL vim syntax file

This is quick and dirty, but at least it's a start
Just save this to your vim syntax folder as ael.vim, do :syntax on if not already on and :set ft=ael, and you're up and running.....

to be continued...


" Vim syntax file
" Language: AEL - the Asterisk Extension Language
" Maintainer: Roy Sigurd Karlsbakk <roy@karlsbakk.net>
" Last Change: 2005 July 8
" vim:path+=/usr/share/vim/vim62

runtime! syntax/c.vim

" the AEL specific stuff
syn case ignore
syn keyword cConstant AbsoluteTimeout AddQueueMember ADSIProg AgentCallbackLogin AgentLogin
syn keyword cConstant AgentMonitorOutgoing AGI AlarmReceiver Answer AppendCDRUserField
syn keyword cConstant Authenticate BackGround BackgroundDetect Busy ChangeMonitor ChanIsAvail
syn keyword cConstant ChanSpy CheckGroup Congestion ControlPlayback Cut DateTime DBdel
syn keyword cConstant DBdeltree DBget DBput DeadAGI Dial Dictate DigitTimeout
syn keyword cConstant Directory DISA DumpChan DUNDiLookup EAGI Echo EndWhile
syn keyword cConstant EnumLookup Eval Exec ExecIf ExecIfTime Festival Flash ForkCDR
syn keyword cConstant GetCPEID GetGroupCount GetGroupMatchCount Goto GotoIf GotoIfTime
syn keyword cConstant Hangup HasNewVoicemail HasVoicemail IAX2Provision ICES ImportVar
syn keyword cConstant LookupBlacklist LookupCIDName Macro MacroExit MacroIf Math MD5 MD5Check
syn keyword cConstant MeetMe MeetMeAdmin MeetMeCount Milliwatt Monitor MP3Player MusicOnHold
syn keyword cConstant MYSQL NBScat NoCDR NoOp Park ParkAndAnnounce ParkedCall
syn keyword cConstant PauseQueueMember Playback Playtones Prefix PrivacyManager Progress Queue
syn keyword cConstant Random Read ReadFile RealTime RealTimeUpdate Record RemoveQueueMember
syn keyword cConstant ResetCDR ResponseTimeout RetryDial Ringing SayAlpha SayCountPL SayDigits
syn keyword cConstant SayNumber SayPhonetic SayUnixTime SendDTMF SendImage SendText SendURL
syn keyword cConstant Set SetAccount SetAMAFlags SetCallerID SetCallerPres SetCDRUserField SetCIDName
syn keyword cConstant SetCIDNum SetGlobalVar SetGroup SetLanguage SetMusicOnHold SetRDNIS SetTransferCapability
syn keyword cConstant SetVar SIPAddHeader SIPDtmfMode SIPGetHeader SMS SoftHangup StartMusicOnHold
syn keyword cConstant StopMonitor StopMusicOnHold StopPlaytones StripLSD StripMSD SubString Suffix
syn keyword cConstant System TestClient TestServer Transfer TrySystem TXTCIDName UnpauseQueueMember
syn keyword cConstant UserEvent Verbose Wait WaitExten WaitForRing WaitForSilence WaitMusicOnHold
syn keyword cConstant While Zapateller ZapBarge ZapRAS ZapScan
syn case match

syn region cString start=/\${/ end=/}/ contains=cString
syn region cKeyword start=/\w+(/ end=/)/ contains=ALL
syn keyword cKeyword macro context globals
syn match cErrInBracket /}$/

set ts=4
set sw=4
set cindent



alternative vim ael syntax highlighting



" Vim syntax file
" Language:     Asterisk ael config file
" Maintainer:   BeF
" Last Change:  2006 Jan 31
" version 0.1
"

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

"testing only
syn sync clear
syn sync fromstart

syn keyword     asteriskTodo    TODO contained
syn match       asteriskComment "//.*" contains=asteriskTodo
 
"syn match      asteriskTop     "^\s*[[:alpha:]]\s+.*\s*{" contains=asteriskTopKeywords
syn match       asteriskTop     "^\s*[[:alpha:]]\s*" contains=asteriskTopKeywords
syn keyword     asteriskTopKeywords     context globals macro contained

syn match       asteriskDialplanSpecial "=>"    contained
syn match       asteriskExten   "\s*[^, ]\+\s*=>" contains=asteriskDialplanSpecial,asteriskPattern contained
syn match       asteriskApplication     "[[[:alnum:]_]\+(.*);" contains=asteriskArgumentSpecial,asteriskVar contained
syn match       asteriskArgumentSpecial "\(|\|&\)" contained
syn match       asteriskFunction        "[[[:alnum:]_]\+(.*)" contains=asteriskFunctionNames,asteriskVar,asteriskFunction contained
syn keyword     asteriskFunctionNames   URIENCODE URIDECODE TXTCIDNAME ENUMLOOKUP CALLERID CURL SORT CUT VMCOUNT QUEUEAGENTCOUNT IAXPEER CHECKSIPDOMAIN SIPCHANINFO SIPPEER SIP_HEADER MUSICCLASS LANGUAGE TIMEOUT DB_EXISTS DB ENV IFTIME IF EXISTS SET ISNULL CDR EVAL STRFTIME LEN REGEX FIELDQTY GROUP_LIST GROUP GROUP_MATCH_COUNT GROUP_COUNT MATH CHECK_MD5 MD5 DUNDILOOKUP contained
syn region      asteriskDialplan        start="{" end="};" contains=asteriskDialplan,asteriskComment,asteriskVar,asteriskExten,asteriskApplication,asteriskFunction




                
                
""              
syn match       asteriskPattern         "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained
syn match       asteriskPattern         "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained
syn match       asteriskVar             "\${_\{0,2}[[:alpha:]][[:alnum:]_]*\(:-\?[[:digit:]]\+\(:[[:digit:]]\+\)\?\)\?}"
syn match       asteriskVar             "_\{0,2}[[:alpha:]][[:alnum:]_]*\ze="
syn match       asteriskVarLen          "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)}" contains=asteriskVar,asteriskVarLen,asteriskExp
syn match       asteriskVarLen          "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskVarLen,asteriskExp
syn match       asteriskExp             "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp



" 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        asteriskTodo Todo
  HiLink        asteriskVar Identifier
  HiLink        asteriskTopKeywords Type
  HiLink        asteriskDialplanSpecial Special
  HiLink        asteriskArgumentSpecial Special
  HiLink        asteriskFunctionNames Function
  HiLink        asteriskPattern         String
 delcommand HiLink
endif


let b:current_syntax = "asterisk"

" vim: ts=8 sw=2


-- Asterisk AEL vim syntax file

This is quick and dirty, but at least it's a start
Just save this to your vim syntax folder as ael.vim, do :syntax on if not already on and :set ft=ael, and you're up and running.....

to be continued...


" Vim syntax file
" Language: AEL - the Asterisk Extension Language
" Maintainer: Roy Sigurd Karlsbakk <roy@karlsbakk.net>
" Last Change: 2005 July 8
" vim:path+=/usr/share/vim/vim62

runtime! syntax/c.vim

" the AEL specific stuff
syn case ignore
syn keyword cConstant AbsoluteTimeout AddQueueMember ADSIProg AgentCallbackLogin AgentLogin
syn keyword cConstant AgentMonitorOutgoing AGI AlarmReceiver Answer AppendCDRUserField
syn keyword cConstant Authenticate BackGround BackgroundDetect Busy ChangeMonitor ChanIsAvail
syn keyword cConstant ChanSpy CheckGroup Congestion ControlPlayback Cut DateTime DBdel
syn keyword cConstant DBdeltree DBget DBput DeadAGI Dial Dictate DigitTimeout
syn keyword cConstant Directory DISA DumpChan DUNDiLookup EAGI Echo EndWhile
syn keyword cConstant EnumLookup Eval Exec ExecIf ExecIfTime Festival Flash ForkCDR
syn keyword cConstant GetCPEID GetGroupCount GetGroupMatchCount Goto GotoIf GotoIfTime
syn keyword cConstant Hangup HasNewVoicemail HasVoicemail IAX2Provision ICES ImportVar
syn keyword cConstant LookupBlacklist LookupCIDName Macro MacroExit MacroIf Math MD5 MD5Check
syn keyword cConstant MeetMe MeetMeAdmin MeetMeCount Milliwatt Monitor MP3Player MusicOnHold
syn keyword cConstant MYSQL NBScat NoCDR NoOp Park ParkAndAnnounce ParkedCall
syn keyword cConstant PauseQueueMember Playback Playtones Prefix PrivacyManager Progress Queue
syn keyword cConstant Random Read ReadFile RealTime RealTimeUpdate Record RemoveQueueMember
syn keyword cConstant ResetCDR ResponseTimeout RetryDial Ringing SayAlpha SayCountPL SayDigits
syn keyword cConstant SayNumber SayPhonetic SayUnixTime SendDTMF SendImage SendText SendURL
syn keyword cConstant Set SetAccount SetAMAFlags SetCallerID SetCallerPres SetCDRUserField SetCIDName
syn keyword cConstant SetCIDNum SetGlobalVar SetGroup SetLanguage SetMusicOnHold SetRDNIS SetTransferCapability
syn keyword cConstant SetVar SIPAddHeader SIPDtmfMode SIPGetHeader SMS SoftHangup StartMusicOnHold
syn keyword cConstant StopMonitor StopMusicOnHold StopPlaytones StripLSD StripMSD SubString Suffix
syn keyword cConstant System TestClient TestServer Transfer TrySystem TXTCIDName UnpauseQueueMember
syn keyword cConstant UserEvent Verbose Wait WaitExten WaitForRing WaitForSilence WaitMusicOnHold
syn keyword cConstant While Zapateller ZapBarge ZapRAS ZapScan
syn case match

syn region cString start=/\${/ end=/}/ contains=cString
syn region cKeyword start=/\w+(/ end=/)/ contains=ALL
syn keyword cKeyword macro context globals
syn match cErrInBracket /}$/

set ts=4
set sw=4
set cindent



alternative vim ael syntax highlighting



" Vim syntax file
" Language:     Asterisk ael config file
" Maintainer:   BeF
" Last Change:  2006 Jan 31
" version 0.1
"

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

"testing only
syn sync clear
syn sync fromstart

syn keyword     asteriskTodo    TODO contained
syn match       asteriskComment "//.*" contains=asteriskTodo
 
"syn match      asteriskTop     "^\s*[[:alpha:]]\s+.*\s*{" contains=asteriskTopKeywords
syn match       asteriskTop     "^\s*[[:alpha:]]\s*" contains=asteriskTopKeywords
syn keyword     asteriskTopKeywords     context globals macro contained

syn match       asteriskDialplanSpecial "=>"    contained
syn match       asteriskExten   "\s*[^, ]\+\s*=>" contains=asteriskDialplanSpecial,asteriskPattern contained
syn match       asteriskApplication     "[[[:alnum:]_]\+(.*);" contains=asteriskArgumentSpecial,asteriskVar contained
syn match       asteriskArgumentSpecial "\(|\|&\)" contained
syn match       asteriskFunction        "[[[:alnum:]_]\+(.*)" contains=asteriskFunctionNames,asteriskVar,asteriskFunction contained
syn keyword     asteriskFunctionNames   URIENCODE URIDECODE TXTCIDNAME ENUMLOOKUP CALLERID CURL SORT CUT VMCOUNT QUEUEAGENTCOUNT IAXPEER CHECKSIPDOMAIN SIPCHANINFO SIPPEER SIP_HEADER MUSICCLASS LANGUAGE TIMEOUT DB_EXISTS DB ENV IFTIME IF EXISTS SET ISNULL CDR EVAL STRFTIME LEN REGEX FIELDQTY GROUP_LIST GROUP GROUP_MATCH_COUNT GROUP_COUNT MATH CHECK_MD5 MD5 DUNDILOOKUP contained
syn region      asteriskDialplan        start="{" end="};" contains=asteriskDialplan,asteriskComment,asteriskVar,asteriskExten,asteriskApplication,asteriskFunction




                
                
""              
syn match       asteriskPattern         "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained
syn match       asteriskPattern         "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained
syn match       asteriskVar             "\${_\{0,2}[[:alpha:]][[:alnum:]_]*\(:-\?[[:digit:]]\+\(:[[:digit:]]\+\)\?\)\?}"
syn match       asteriskVar             "_\{0,2}[[:alpha:]][[:alnum:]_]*\ze="
syn match       asteriskVarLen          "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)}" contains=asteriskVar,asteriskVarLen,asteriskExp
syn match       asteriskVarLen          "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskVarLen,asteriskExp
syn match       asteriskExp             "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp



" 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        asteriskTodo Todo
  HiLink        asteriskVar Identifier
  HiLink        asteriskTopKeywords Type
  HiLink        asteriskDialplanSpecial Special
  HiLink        asteriskArgumentSpecial Special
  HiLink        asteriskFunctionNames Function
  HiLink        asteriskPattern         String
 delcommand HiLink
endif


let b:current_syntax = "asterisk"

" vim: ts=8 sw=2


Created by: rkarlsba, Last modification: Wed 01 of Feb, 2006 (00:16 UTC) by bef
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+