Vim plug-in for PHP syntax automatic check, php syntax vim_PHP tutorial

Source: Internet
Author: User
The Vim plug-in that automatically checks PHP syntax, and the php syntax vim. The Vim plug-in that automatically checks PHP syntax. The php syntax vim is hard to avoid syntax errors such as a semicolon due to a large number of PHP statements recently written, the general check method is to return to the Vim plug-in that runs PHP syntax to automatically check the command line, and the php syntax vim

Due to the large number of PHP statements recently, it is inevitable that you may accidentally write less semicolons or other syntax errors. the general check method is to return to the command line to run php-l, or you can upgrade it and run it directly in Vim :! Php-l %, or bind this as a shortcut key, for example, map :! Php-l % You can immediately perform a syntax check whenever you press F5. However, I still feel a little uncomfortable, because many Ides perform real-time checks, and syntax errors are prompted next to the code line. Although real-time check is not necessary, automatic check is much more convenient than manual check. for example, automatic check is performed when the php file is saved.

So I wrote this phpcheck. vim plug-in. the basic function is to check the syntax when saving the php file. if there is a mistake, a prompt is displayed. if there is no error, no prompt is displayed. This plug-in may not be visible most of the time, but the prompt is displayed when a syntax error occurs occasionally by mistake.

The error message is shown in:

The error message contains the error message and the error row number.

Plugin download

Http:// Script_id = 1, 4984
Plugin installation

Put the downloaded phpcheck. vim in your

~ /. Vim/plugin/

Or plug-in/in the Vim installation path /.

Plug-in configuration

In most cases, configuration is not required. If your phpbin directory is not in the system environment variable, you can specify the phpbin path as follows:

Let g: PHP_SYNTAX_CHECK_BIN = '/apps/php/bin/php'

How can I use vim to edit the php language quickly (Auto Indent )? How to set it? ,,,

This should be because php syntax files are missing, not configuration issues. check whether php syntax files exist in the syntax folder.

Why does the VIM Syntax Highlight disappear after saving the file?

If you can, send your vimrc [, gvimrc] file, and the list of plug-ins you are using. the setting conflict should not be caused by any exceptions.

Because PHP has been frequently written recently, it is inevitable that you may accidentally write less semicolons or other syntax errors. the general check method is to return to the Command Line for running...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.