Module: sip-router
Branch: master
Commit: 7943249ea75d8103d1364bcb4b6a63a2e685e88a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7943249…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Sep 25 13:52:05 2012 +0200
utils/misc: few updates to vim syntax highlighting
---
utils/misc/vim/ftdetect/ser.vim | 8 +++++++-
utils/misc/vim/syntax/ser.vim | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/utils/misc/vim/ftdetect/ser.vim b/utils/misc/vim/ftdetect/ser.vim
index 478220e..641b638 100644
--- a/utils/misc/vim/ftdetect/ser.vim
+++ b/utils/misc/vim/ftdetect/ser.vim
@@ -6,7 +6,13 @@ func! s:cfgType()
if getline(n) =~ '^\s*#!\(KAMAILIO\|OPENSER\|SER\|ALL\|MAXCOMPAT\)'
set filetype=ser
return
- elseif getline(n) =~ '^\s*modparam\s*(\s*"[^"]\+"'
+ elseif getline(n) =~ '^\s*#!\(define\|ifdef\|endif\|subst\|substdef\)'
+ set filetype=ser
+ return
+ elseif getline(n) =~ '^\s*!!\(define\|ifdef\|endif\|subst\|substdef\)'
+ set filetype=ser
+ return
+ elseif getline(n) =~ '^\s*modparam\s*(\s*"[^"]\+"'
set filetype=ser
return
elseif getline(n) =~ '^\s*route\s*{\s*'
diff --git a/utils/misc/vim/syntax/ser.vim b/utils/misc/vim/syntax/ser.vim
index f9caddd..04d8278 100644
--- a/utils/misc/vim/syntax/ser.vim
+++ b/utils/misc/vim/syntax/ser.vim
@@ -34,7 +34,7 @@ syn keyword serTodo TODO FIXME XXX contained
syn
match serOperator '!\|&&\|||\|=[~=]\?\|>\|<\|+\|-\|/\|\*\||\|&\|^\|\~\|defined\|eq\|ieq\|ne\|ine\|mod'
display contained
syn region serCppComment start='/\*' end='\*/' contains=serTodo
-syn
match serHashDefine '#!define\s\|#!ifdef\s\|#!ifndef\s\|#!endif\|#!else\|#!subst\|!!define\s\|!!ifdef\s\|!!ifndef\s\|!!endif\|!!else\|!!subst\|#!KAMAILIO\|#!OPENSER\|#!SER\|#!MAXCOMPAT\|#!ALL'
+syn
match serHashDefine '#!define\s\|#!ifdef\s\|#!ifndef\s\|#!endif\|#!else\|#!substdef\|#!subst\|!!define\s\|!!ifdef\s\|!!ifndef\s\|!!endif\|!!else\|!!substdef\|!!subst\|#!KAMAILIO\|#!OPENSER\|#!SER\|#!MAXCOMPAT\|#!ALL'
" syn match serHashDefine '^\s*#!.+$'
syn match serHashComment '#[^!].*$\|#$' contains=serTodo
@@ -43,7 +43,7 @@ syn match serNumber '[0-9]\+' contained
syn region serString matchgroup=Normal start='"' skip='\\"'
end='"' contained contains=serVariable,serStringEscape
syn match serVariable "$[a-zA-Z_][a-zA-Z0-9_]*\(([^)]\+)\)\?" contained
syn match serIdentifier '[a-zA-Z_][a-zA-Z0-9_]*' contained
-syn keyword serStatement route if else switch case default break exit return drop while
include_file contained
+syn keyword serStatement route if else switch case default break exit return drop while
include_file import_file contained
syn keyword serSpecial yes no on off true false enabled disabled contained
syn keyword serCoreKeyword af dst_ip dst_port from_uri method msg:len proto status snd_af
snd_ip snd_port snd_proto src_ip src_port to_af to_ip to_port to_proto to_uri uri uri:host
uri:port contained