StanAngeloff / php.vim

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

highlighting files without "<?php" #83

Closed willxy closed 6 years ago

willxy commented 6 years ago

Is there a way to enable highlighting on files that don't begin with <?php ?

Eg: https://stackoverflow.com/questions/28957726/vims-php-syntax-highlighting-ignores-non-scripty-php-files

StanAngeloff commented 6 years ago

Whilst this is not very useful to many, you can work your way around it by running the following code:

syn region phpRegion start=@^@ end=@$@ contains=@phpClTop

This will make phpRegion work across the file which will then trigger highlighting.

willxy commented 6 years ago

I'll give that a shot. Thanks!

Edit: Works perfect. Thanks again!