Vim plug-in for PHP syntax automatic check

Source: Internet
Author: User
Vim is a text editor developed from vi. Code completion, compilation, error jump, and other convenient programming functions are particularly rich and widely used by programmers. It is used in parallel with Emacs to become your favorite editor for Unix-like systems. 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://www.vim.org/scripts/script.php? 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'

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: info-contact@alibabacloud.com 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.