As a result of the recent write PHP more, occasionally hand mistakenly write a semicolon and so on grammatical errors unavoidably, the general check way is to return to the command line to run Php-l, or upgrade the direct in vim run:!php-l%, or again this binding as shortcut keys, such as: Map <F5>:!php-l %<cr>, every time you press F5, you can perform a grammar check immediately. But still feel slightly uncomfortable, because many Ides are checked in real time, syntax errors will be prompted next to the line of code. While real-time checking may not be necessary, automatic checking is more convenient than manual checking, such as automatically performing checks when PHP files are saved.
So wrote this Phpcheck.vim plug-in, the basic function is to save the PHP file syntax check, there are errors will be prompted, no error will not have any hint. Most of the time will not be able to see the effect of this plug-in, but occasionally the hand mistakenly appear syntax errors, you will see the hint.
The error message is shown in the following illustration:
The error message contains error messages and error line numbers.
Plugin download
http://www.vim.org/scripts/script.php?script_id=4984
Plug-in installation
Put the downloaded Phpcheck.vim in your
~/.vim/plugin/
or vim in the installation path of the plugin/.
Plug-in configuration
Most of the cases are not configured. If your Phpbin directory is not in the system's environment variable, you can specify the path to the Phpbin, as follows:
Let G:php_syntax_check_bin = '/apps/php/bin/php '