StanAngeloff / php.vim

An up-to-date Vim syntax for PHP (7.x supported)
477 stars 69 forks source link

Support "use function" properly. Fixes #42. #45

Closed msjyoo closed 8 years ago

msjyoo commented 9 years ago

Works on my machine!

I used regex negative lookbehind, couldn't figure out how to do syntax blacklisting.

StanAngeloff commented 8 years ago

Hey,

I've been holding back on merging this as it seems to work, but solves the issue in a less than elegant manner. I'll try to allocate some time to refactor.

msjyoo commented 8 years ago

No problem. It's here for anyone that needs a temporary solution, but feel free to close this.

StanAngeloff commented 8 years ago

I've added a new branch use-function with numerous additions. These are best described via a screenshot:

hi phpUseClass ctermbg=red
hi phpUseAlias ctermbg=darkgreen
hi phpUseFunction ctermbg=blue

The code above is optional and allows you to customise the new matches. If you leave out this configuration, you should find that the identifier following function is no longer highlighted as phpFunction.

Can you give the use-function branch a spin and let me know if it works for you?

msjyoo commented 8 years ago

Can confirm that it works as expected!