Ⅰ. 插件描述
highlight unused/unassigned local variableⅡ. 基本信息
|
Ⅲ. 安装方法
使用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