1 Introduction When the PHP file is saved, the grammar check automatically, there are errors will prompt, no errors do not prompt. * Syntax Checker uses the system's PHP-L-n command; * does not work for non-PHP files;
2 Downloads (vversion 1.1) http://www.vim.org/scripts/script.php?script_id=4984
3 Installation
# Whereis Vim
Upload Plugin (phpcheck.vim) to plugin directory
# cd/usr/share/vim/vim74/plugin/
# rz-y
4 Use
test10.php
<?php$a = 1$b = 2?>
When executing w write, error message
5 Phpcheck.vim Content
"PHP Syntax Check plugin phpcheck.vim" 2014.7.9 php save automatically Check "2014.8.8 plus-N, *.php, remove judgment, shortcut" @author quanhengzhuangautocmd bufwritepost * . PHP call Phpsyntaxcheck () if!exists (' G:php_syntax_check_bin ') let g:php_syntax_check_bin = ' php ' endiffunction! Phpsyntaxcheck () Let result = System (g:php_syntax_check_bin. '-l-n '. Expand ('% ')) if (stridx (result, ' No Syntax errors detected ') = =-1) Echohl warningmsg | echo result | Echohl None endifendfunction
Vim plugin Phpcheck installation and use-efficient checking of PHP syntax errors