Skip to content

Commit aca1925

Browse files
committed
Add new matche, phpUseAlias.
This can be used to customise how a class or function alias is highlighted: use Class\Name as ClassAlias; use function function\name as functionAlias;
1 parent b880101 commit aca1925

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

syntax/php.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,12 @@ syntax match phpClassDelimiter contained
682682
" use statement
683683
syn keyword phpInclude use contained
684684
\ nextgroup=phpUseFunction,phpUseClass skipwhite skipempty
685-
syn match phpUseFunction /function\s\+\(\\\|\h\w*\)*\h\w*/ contained contains=phpUseKeyword
686-
syn match phpUseClass /\(function\s\+\)\@!\(\\\|\h\w*\)*\h\w*/ contained
687-
syn match phpUseKeyword /function\s\+/ contained contains=phpKeyword
685+
syn match phpUseFunction /function\_s\+\(\\\|\h\w*\)*\h\w*/ contained contains=phpUseKeyword
686+
\ nextgroup=phpUseAlias skipwhite skipempty
687+
syn match phpUseClass /\(function\_s\+\)\@!\(\\\|\h\w*\)*\h\w*/ contained
688+
\ nextgroup=phpUseAlias skipwhite skipempty
689+
syn match phpUseAlias /as\_s\+\h\w*/ contained contains=phpUseKeyword
690+
syn match phpUseKeyword /\(function\|as\)\_s\+/ contained contains=phpKeyword
688691

689692
" Function name
690693
syn keyword phpKeyword function contained

0 commit comments

Comments
 (0)