Merge @aantonello commits.
This commit merges parts of:9d24eab4ea
63c93d8825
The syntax file is more closely aligned with the generic syntax highlighting groups in Vim. This didn't change highlighting for my custom syntax colours, hopefully it will not affect others as well.
This commit is contained in:
parent
36ccde5296
commit
4cd4f224ec
1 changed files with 28 additions and 21 deletions
|
@ -1,9 +1,14 @@
|
|||
" Vim syntax file
|
||||
" Language: PHP 5.3 & up
|
||||
"
|
||||
" Maintainer: Paul Garvin <paul@paulgarvin.net>
|
||||
"
|
||||
" Contributor: Stan Angeloff <stanimir@angeloff.name>
|
||||
" URL: https://github.com/StanAngeloff/php.vim
|
||||
"
|
||||
" Contributor: Alessandro Antonello <aleantonello@hotmail.com>
|
||||
" URL: https://github.com/aantonello/php.vim
|
||||
"
|
||||
" Former Maintainer: Peter Hodge <toomuchphp-vim@yahoo.com>
|
||||
" Former URL: http://www.vim.org/scripts/script.php?script_id=1571
|
||||
"
|
||||
|
@ -316,7 +321,10 @@ syn keyword phpFunctions readgzfile gzrewind gzclose gzeof gzgetc gzgets gzgetss
|
|||
syntax keyword phpClasses containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
|
||||
|
||||
" Control Structures
|
||||
syn keyword phpStatement if else elseif while do for foreach break switch case default continue return goto as endif endwhile endfor endforeach endswitch declare endeclare contained
|
||||
syn keyword phpKeyword if echo else elseif while do for foreach function break switch case default continue return goto as endif endwhile endfor endforeach endswitch declare endeclare print new clone contained
|
||||
|
||||
" Exception Keywords
|
||||
syn keyword phpKeyword try catch throw contained
|
||||
|
||||
" Class Keywords
|
||||
syn keyword phpType class abstract extends interface implements static final var public private protected const trait contained
|
||||
|
@ -324,14 +332,8 @@ syn keyword phpType class abstract extends interface implements static final var
|
|||
" Magic Methods
|
||||
syn keyword phpStatement __construct __destruct __call __callStatic __get __set __isset __unset __sleep __wakeup __toString __invoke __set_state __clone contained
|
||||
|
||||
" Exception Keywords
|
||||
syn keyword phpStatement try catch throw contained
|
||||
|
||||
" Language Constructs
|
||||
syn keyword phpStatement die exit eval empty isset unset list instanceof insteadof contained
|
||||
|
||||
" These special keywords have traditionally received special colors
|
||||
syn keyword phpSpecial function echo print new clone contained
|
||||
syn keyword phpKeyword die exit eval empty isset unset list instanceof insteadof contained
|
||||
|
||||
" Include & friends
|
||||
syn keyword phpInclude include include_once require require_once namespace use contained
|
||||
|
@ -380,6 +382,11 @@ syn match phpSpecialChar +\\"+ contained display
|
|||
syn match phpStrEsc "\\\\" contained display
|
||||
syn match phpStrEsc "\\'" contained display
|
||||
|
||||
" Format specifiers (printf)
|
||||
" See https://github.com/aantonello/php.vim/commit/9d24eab4ea4b3752a54aebf14d3491b6d8edb6d8
|
||||
syn match phpSpecialChar display contained /%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([aAbBdiouxXDOUfFeEgGcCsSpnmMyYhH]\|\[\^\=.[^]]*\]\)/ containedin=phpStringSingle,phpStringDouble,phpHereDoc
|
||||
syn match phpSpecialChar display contained /%%/ containedin=phpStringSingle,phpStringDouble,phpHereDoc
|
||||
|
||||
" Error
|
||||
syn match phpOctalError "[89]" contained display
|
||||
if exists("php_parent_error_close")
|
||||
|
@ -442,9 +449,9 @@ else
|
|||
endif
|
||||
|
||||
" Clusters
|
||||
syn cluster phpClConst contains=phpFunctions,phpClasses,phpIdentifier,phpStatement,phpOperator,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstants,phpException,phpSuperglobals,phpMagicConstants,phpServerVars
|
||||
syn cluster phpClConst contains=phpFunctions,phpClasses,phpIdentifier,phpStatement,phpKeyword,phpOperator,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstants,phpException,phpSuperglobals,phpMagicConstants,phpServerVars
|
||||
syn cluster phpClInside contains=@phpClConst,phpComment,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc
|
||||
syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass,phpSpecial
|
||||
syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass,phpKeyword
|
||||
syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch
|
||||
|
||||
" Php Region
|
||||
|
@ -501,32 +508,32 @@ if !exists("did_php_syn_inits")
|
|||
hi def link phpServerVars Constant
|
||||
hi def link phpConstants Constant
|
||||
hi def link phpBoolean Constant
|
||||
hi def link phpNumber Constant
|
||||
hi def link phpNumber Number
|
||||
hi def link phpStringSingle String
|
||||
hi def link phpStringDouble String
|
||||
hi def link phpBacktick String
|
||||
hi def link phpHereDoc String
|
||||
hi def link phpNowDoc String
|
||||
hi def link phpFunctions Identifier
|
||||
hi def link phpClasses Identifier
|
||||
hi def link phpMethods Identifier
|
||||
hi def link phpFunctions Function
|
||||
hi def link phpMethods Function
|
||||
hi def link phpClasses StorageClass
|
||||
hi def link phpException StorageClass
|
||||
hi def link phpIdentifier Identifier
|
||||
hi def link phpIdentifierSimply Identifier
|
||||
hi def link phpStatement Statement
|
||||
hi def link phpStructure Statement
|
||||
hi def link phpException Statement
|
||||
hi def link phpOperator Operator
|
||||
hi def link phpVarSelector Operator
|
||||
hi def link phpInclude PreProc
|
||||
hi def link phpDefine PreProc
|
||||
hi def link phpSpecial PreProc
|
||||
hi def link phpFCKeyword PreProc
|
||||
hi def link phpKeyword Keyword
|
||||
hi def link phpFCKeyword Keyword
|
||||
hi def link phpSCKeyword Keyword
|
||||
hi def link phpType Type
|
||||
hi def link phpSCKeyword Type
|
||||
hi def link phpMemberSelector Type
|
||||
hi def link phpSpecialChar Special
|
||||
hi def link phpStrEsc Special
|
||||
hi def link phpMemberSelector Operator
|
||||
hi def link phpParent Special
|
||||
hi def link phpSpecialChar SpecialChar
|
||||
hi def link phpStrEsc SpecialChar
|
||||
hi def link phpParentError Error
|
||||
hi def link phpOctalError Error
|
||||
hi def link phpTodo Todo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue