The bleeding edge PHP syntax file!
Find a file
Joshua Sherman dfe51a3864 Merge remote-tracking branch 'upstream/master'
Conflicts:
	syntax/php.template
	syntax/php.vim

Attempted to merge in upstream changes as they claimed to have fixed an issue
that broke spell checking presumably introduced by my branch. I was unable to
get spell checking working with the syntax file that was part of my original
fork: 36ccde5296

Because of this I left my script as is in favor of highlighting just the
@attribute part of the docblock and not highlighting the entire comment string
which appeared visually awkward to me. Ideally I'd love to get spell checking
working in all the places that it should be working but that seems to be a
bigger issue all together.

Also added support for the @usage attribute as it's something that is fairly
common albeit not standard docblocking
2014-01-14 00:23:14 -05:00
syntax Merge remote-tracking branch 'upstream/master' 2014-01-14 00:23:14 -05:00
README.md Updated against PHP 5.5.8 2014-01-13 23:10:35 -05:00
update_syntax.php Enabling more modules 2014-01-13 23:32:12 -05:00

php.vim

This project is a fork of php.vim which is an improved version of php.vim--Garvin which in turn is an update of the php.vim script which in turn is an updated version of the php.vim syntax file distributed with Vim.

The point of this fork is to embrace the latest and greatest PHP has to offer and constantly update against the latest PHP release.

Last updated against 5.5.8

Improvements

  • Spell checking was enabled in strings and comments (both single and multi-line).

  • Spell checking was enabled in heredocs, e.g., <<<EOD.

  • The PHP built-in and extension-provided functions list was updated for PHP 5.3.

  • Compatibility with html5.vim.

  • Support for not-so-common extensions was turned off, e.g., mssql_*.

  • Basic support for PHP 5.4 syntax was added.

  • Support was added for PHP 5.5.7

  • New modules added: memcache, memcached, redis, test_helpers and xdebug

  • Support for static classes and docblock parameters (patched by @kris89)

Customising

A script update_syntax.php is provided to re-generate the syntax file. A single variable $allowed_extensions can be customised to turn on/off certain extensions.

When re-generating the syntax file, you must have allowed extensions installed.

Original README

This is an updated version of the php.vim syntax file distributed with VIM. The list of PHP constants, functions, and classes was updated to be current with PHP 5.3. Many new classes were added in the 5.2 branch and the distributed version only covers up to 5.1.4. In addition I simplified the file, removing several sections that are not often used (at least by me) such as automatic folding of all control structures and ASP tags support. I also removed several switches designed for b/c with VIM 5.X and 6.X. As an addition I have included the PHP file I used to generate the constant, function, class list. It uses reflection to mine out these items from your PHP installation and generate part of the php.vim script. Before running open up the file and adjust the output file location and the list of extensions to generate syntax for. Then run "php php_vimgen.php" from your shell.