phpcomplete.vim


Ⅰ. 插件描述

Improved PHP omnicompletion

Ⅱ. 基本信息

创建日期:  2010-07-28
使用用户:  3
Github星:  5
插件作者:  Sebastian Keßler

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Default phpcomplete.vim does not support in-file checking of $var = new Class; so if you don't have a tags file with the variable in it already you have to hack around it by placing the comment /* @var $yourvar YourClass */ above the line which is really kludgy.

This patch allows for in-file checking so you don't need the comment.

$instance = new Class;
...
$instance->Blah(); // <-- complete without comment

It also allows support for singleton instantiations:

$instance = Class::getInstance();
$instance->completeMe(); // sweet completion

Other features:

  • Correct restriction of static or standard methods based on context ( show only static methods with :: and only standard with ->)
  • Real support for self:: and $this-> with the aforementioned context restriction
  • Constant variable completion (not just define(VARIABLE, 1) but const VARIABLE = 1)

添加新评论