Added Static class and docblock highlighting

This is actually a rework of the patch @kris89 sent in that adds the syntax to the php.template file so they won't be lost when regenerating the php.vim file. Thanks @kris89 !!
This commit is contained in:
Joshua Sherman 2014-01-06 09:35:58 -05:00
parent 249550d2c2
commit 45af33ff74
2 changed files with 10 additions and 4 deletions

View file

@ -157,6 +157,7 @@ syn match phpMemberSelector "->" contained display
syn match phpVarSelector "\$" contained display syn match phpVarSelector "\$" contained display
" highlight object variables inside strings " highlight object variables inside strings
syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display containedin=phpStringDouble syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display containedin=phpStringDouble
syn match phpClasses "\v[A-Za-z]+(::)@=" contained display
" Identifier " Identifier
syn match phpIdentifier "$\h\w*" contained contains=phpSuperglobals,phpVarSelector display syn match phpIdentifier "$\h\w*" contained contains=phpSuperglobals,phpVarSelector display
@ -198,12 +199,13 @@ endif
" Todo " Todo
syn keyword phpTodo todo fixme xxx note contained syn keyword phpTodo todo fixme xxx note contained
syn match phpCommentSelector "\v\@(return|var|param)" contained
" Comment " Comment
if exists("php_parent_error_open") if exists("php_parent_error_open")
syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,phpCommentSelector,@Spell
else else
syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell extend syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,phpCommentSelector,@Spell extend
endif endif
syn match phpCommentStar contained "^\s*\*[^/]"me=e-1 syn match phpCommentStar contained "^\s*\*[^/]"me=e-1
@ -350,6 +352,7 @@ if !exists("did_php_syn_inits")
hi def link phpStructure Statement hi def link phpStructure Statement
hi def link phpOperator Operator hi def link phpOperator Operator
hi def link phpVarSelector Operator hi def link phpVarSelector Operator
hi def link phpCommentSelector PreProc
hi def link phpInclude PreProc hi def link phpInclude PreProc
hi def link phpDefine PreProc hi def link phpDefine PreProc
hi def link phpKeyword Keyword hi def link phpKeyword Keyword

View file

@ -384,6 +384,7 @@ syn match phpMemberSelector "->" contained display
syn match phpVarSelector "\$" contained display syn match phpVarSelector "\$" contained display
" highlight object variables inside strings " highlight object variables inside strings
syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display containedin=phpStringDouble syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display containedin=phpStringDouble
syn match phpClasses "\v[A-Za-z]+(::)@=" contained display
" Identifier " Identifier
syn match phpIdentifier "$\h\w*" contained contains=phpSuperglobals,phpVarSelector display syn match phpIdentifier "$\h\w*" contained contains=phpSuperglobals,phpVarSelector display
@ -425,12 +426,13 @@ endif
" Todo " Todo
syn keyword phpTodo todo fixme xxx note contained syn keyword phpTodo todo fixme xxx note contained
syn match phpCommentSelector "\v\@(return|var|param)" contained
" Comment " Comment
if exists("php_parent_error_open") if exists("php_parent_error_open")
syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,phpCommentSelector,@Spell
else else
syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell extend syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,phpCommentSelector,@Spell extend
endif endif
syn match phpCommentStar contained "^\s*\*[^/]"me=e-1 syn match phpCommentStar contained "^\s*\*[^/]"me=e-1
@ -577,6 +579,7 @@ if !exists("did_php_syn_inits")
hi def link phpStructure Statement hi def link phpStructure Statement
hi def link phpOperator Operator hi def link phpOperator Operator
hi def link phpVarSelector Operator hi def link phpVarSelector Operator
hi def link phpCommentSelector PreProc
hi def link phpInclude PreProc hi def link phpInclude PreProc
hi def link phpDefine PreProc hi def link phpDefine PreProc
hi def link phpKeyword Keyword hi def link phpKeyword Keyword