PHP语法自动检查的Vim插件,php语法vim
由于最近写PHP比较多,偶尔手误少写个分号之类的语法错误难免,一般的检查方式是回到命令行运行 php -l ,或者升级一下直接在Vim里运行 :!php -l % ,或者再将此绑定为快捷键,如 :map
于是写了这个 phpcheck.vim 插件,基本功能就是 在PHP文件保存时进行语法检查,有错误会提示出来,没错误不会有任何提示。 可能大部分时候都不会看不到这个插件的效果,只是偶尔手误出现语法错误时,会看到提示。
错误提示如下图所示:
错误提示包含错误信息和错误行号。
插件下载
http://www.vim.org/scripts/script.php?script_id=4984
插件安装
将下载的phpcheck.vim放入你的
~/.vim/plugin/
或Vim安装路径里的plugin/。
插件配置
大部分情况下是不用的配置的。如果你的phpbin所在目录不在系统的环境变量的话,可以指定phpbin的路径,如下:
let g:PHP_SYNTAX_CHECK_BIN = ‘/apps/php/bin/php'
这个应该是少了php的语法文件,不是配置的问题检查下syntax文件夹里是否有php的语法文件
可以的话发一下你的vimrc[,gvimrc]文件,还有你使用的插件列表,不出意外应该是设置冲突。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
