php.vim


Ⅰ. 插件描述

Original indent for php

Ⅱ. 基本信息

创建日期:  2002-07-20
使用用户:  71
Github星:  2
插件作者:  Miles Lott

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/php-vim-looking-forward'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/php-vim-looking-forward'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/php-vim-looking-forward'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/php.vim

Ⅳ. 文档说明

This was the original vim php indent file written in 2002 and included in Vim 6.X releases.  It still works with the latest 7.X release.

Indents after <?php tag, <? tag (optional), ( )or { }.  The script can also format switch/case statements and more recently will automatically format / comment sections /

It likes the following format:

    if($something)
    {
         dothis();
    }

OR
    if($thisone) {
        dothis();
    }

Comment sections are automatically formatted, adding the on a new line until closure by / :

/* Comment line 1

  • Line 2
    */

Comments done using # also receive a new line with the # prepended.  But, you will have to end it manually since there is no difference between lines and the end of such sections.
Comments done using // also receive a new line with the // prepended.  But, you will have to end it manually since there is no difference between lines and the end of such sections.

It was not designed to and will not handle if blocks etc. without brackets and also does not format html.  Please use braces and separate display logic for more readable code.

添加新评论