PHP syntax automatic check for VIM plugin _php

Source: Internet
Author: User
Keywords Phpcheck vim Plug-in
Due to the recent write PHP more, occasionally hand-less write a semicolon and other grammatical errors, the general way is to go back to the command line run Php-l, or upgrade directly in Vim run:!php-l%, or then bind this as a shortcut key, such as: Map :!php-l% , you can perform a grammar check immediately whenever you press F5. But still feel slightly uncomfortable, because many Ides are checked in real time, syntax errors will prompt the line of code next. While real-time checking may not be necessary, automatic checking is much easier than manual checking, such as checking automatically when a PHP file is saved.

So wrote this Phpcheck.vim plug-in, the basic function is in the PHP file save grammar Check, there are errors will prompt out, no error will not have any hint. Most of the time, you will not see the effect of this plugin, but occasionally hand errors in grammar, you will see the prompt.

The error message is as follows:

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 plugin/in the Vim installation path.

Plug-in configuration

Most of the cases are not configured. If your Phpbin directory is not in the system environment variable, you can specify the path of Phpbin, 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.