php_localvarcheck.vim


Ⅰ. 插件描述

highlight unused/unassigned local variable

Ⅱ. 基本信息

创建日期:  2009-10-07
使用用户:  9
Github星:  4
插件作者:  flyinshadow

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2803

function example($unused) {
echo $unassigned;
}

$unused and $unassigned are highlighted when the cursor is in example().

Bugfix: when use this plugin in vim7.4, I got the following error:

Error detected while processing function <SNR>79_LocalVarCheck..<SNR>79_FindBadVariables..<SNR>79_Parse:
line   72:
E874: (NFA) Could not pop the stack !

Solution: need to escape a & character if use v in a pattern, and expect to match a literal '&' character
@see https://groups.google.com/forum/#!topic/vim_dev/4L7p28MYIX0

添加新评论