Created
January 23, 2013 17:03
-
-
Save anonymous/4610024 to your computer and use it in GitHub Desktop.
/home/thesame/.vim/syntax/php-turbo.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if version < 600 | |
syntax clear | |
elseif exists("b:current_syntax") | |
finish | |
endif | |
if !exists("main_syntax") | |
let main_syntax = 'php' | |
endif | |
runtime syntax/html.vim | |
unlet b:current_syntax | |
syn cluster phpEverything contains=phpKeyword,phpComment,phpOperator,phpSpecialChar,phpIdentifier,phpIdentifierSimply,phpStringDouble,phpStringSingle,phpBacktick,phpDefine,phpInclude,phpStorageClass,phpStructure,phpConditional,phpStatement,phpType,phpLabel,phpRepeat,phpSCKeyword,phpFCKeyword,phpException,phpParent | |
syn match phpOperator "[-=+%^&|*!.~?:]" contained display | |
syn match phpOperator "[-+*/%^&|.]=" contained display | |
syn match phpOperator "/[^*/]"me=e-1 contained display | |
syn match phpOperator "&&\|\<and\>" contained display | |
syn match phpOperator "||\|\<x\=or\>" contained display | |
syn match phpOperator "[!=<>]=" contained display | |
syn match phpOperator "[<>]" contained display | |
syn match phpOperator "->" contained display | |
syn match phpParent "[()]" contained display | |
"syn match phpOperator "[-=+%^&|*!.~?:()<>]" | |
"syn region phpRegion start="<?php" end="?>" contains=@phpEverything fold transparent | |
"syn region phpRegion start="<?" end="?>" contains=@phpEverything transparent | |
syn region phpRegion matchgroup=Delimiter start="<?" end="?>" contains=@phpEverything transparent | |
"syn region phpRegion start="<?=" end="?>" contains=@phpEverything fold transparent | |
syn keyword phpSCKeyword abstract final private protected public static contained | |
syn keyword phpFCKeyword function contained | |
syn keyword phpStorageClass global contained | |
syn keyword phpDefine new clone contained | |
syn keyword phpBoolean true false contained | |
syn keyword phpInclude include require include_once require_once contained | |
syntax keyword phpDefine echo print contained | |
syntax keyword phpStructure list contained | |
syntax keyword phpConditional switch contained | |
syntax keyword phpStatement die contained | |
" Conditional | |
syn keyword phpConditional declare else enddeclare endswitch elseif endif if switch contained | |
" Repeat | |
syn keyword phpRepeat as do endfor endforeach endwhile for foreach while contained | |
" Repeat | |
syn keyword phpLabel case default switch contained | |
" Statement | |
syn keyword phpStatement return break continue exit contained | |
" Keyword | |
syn keyword phpKeyword var const contained | |
" Type | |
syn keyword phpType bool[ean] int[eger] real double float string array object NULL contained | |
" Structure | |
syn keyword phpStructure extends implements instanceof parent self contained | |
syn sync match phpRegionSync grouphere phpRegion "^\s*<?php\s*$" | |
syn sync match phpRegionSync grouphere NONE "^\s*?>\s*$" | |
syn sync match phpRegionSync grouphere NONE "^\s*%>\s*$" | |
syn keyword phpDefine function contained | |
syn keyword phpStructure abstract class interface contained | |
syn keyword phpException catch throw try contained | |
syn keyword phpStorageClass final global private protected public static contained | |
syn match phpComment "//.*$" contained display | |
syn match phpComment "#.*$" contained display | |
syn region phpComment start="/\*" end="\*/" contained | |
syn match phpSpecialChar "\\[abcfnrtyv\\]" contained display | |
syn match phpSpecialChar "\\\d\{3}" contained display | |
syn match phpSpecialChar "\\x\x\{2}" contained display | |
syn match phpIdentifier "$\h\w*" contained display | |
syn match phpIdentifierEmbed "{$.*}" contains=phpIdentifier,phpStringSingle contained display | |
syn region phpStringDouble matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=phpIdentifier,phpIdentifierEmbed,phpSpecialChar,phpIdentifierSimply contained keepend | |
syn region phpBacktick matchgroup=None start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=phpIdentifier,phpSpecialChar,phpIdentifierSimply contained keepend | |
syn region phpStringSingle matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contained keepend | |
hi link phpKeyword Statement | |
hi link phpComment Comment | |
hi link phpOperator Operator | |
hi link phpStringDouble String | |
hi link phpBacktick String | |
hi link phpStringSingle String | |
hi link phpSpecialChar SpecialChar | |
hi link phpIdentifier Identifier | |
hi link phpIdentifierSimply Identifier | |
hi link phpConstant Constant | |
hi link phpCoreConstant Constant | |
hi link phpComment Comment | |
hi link phpException Exception | |
hi link phpBoolean Boolean | |
hi link phpStorageClass StorageClass | |
hi link phpSCKeyword StorageClass | |
hi link phpFCKeyword Define | |
hi link phpStructure Structure | |
hi link phpStringSingle String | |
hi link phpStringDouble String | |
hi link phpBacktick String | |
hi link phpNumber Number | |
hi link phpFloat Float | |
hi link phpMethods Function | |
hi link phpFunctions Function | |
hi link phpBaselib Function | |
hi link phpRepeat Repeat | |
hi link phpConditional Conditional | |
hi link phpLabel Label | |
hi link phpStatement Statement | |
hi link phpKeyword Statement | |
hi link phpType Type | |
hi link phpInclude Include | |
hi link phpDefine Define | |
hi link phpSpecialChar SpecialChar | |
hi link phpParent Delimiter | |
hi link phpIdentifierConst Delimiter | |
hi link phpParentError Error | |
hi link phpOctalError Error | |
hi link phpTodo Todo | |
hi link phpMemberSelector Structure | |
let b:current_syntax = "php" | |
if main_syntax == 'php' | |
unlet main_syntax | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment