Ⅰ. 插件描述
Highlight Ruby local variablesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'todesking/ruby-hl-lvar-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'todesking/ruby-hl-lvar-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'todesking/ruby-hl-lvar-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/todesking/ruby_hl_lvar.vim
Ⅳ. 文档说明
# ruby_hl_lvar.vim
Highlight local variables in Ruby files.

Requirements
- Vim Ruby interface(
has('ruby')) enabled and Ruby's version = 2.0.0 (You can check by:ruby puts RUBY_VERSION)
Other versions of Rubies, whitch version is >= 1.9.0 may works, but I tested under only 2.0.0.
Bug reports are welcome.
Usage
Install and open any .rb file. Advanced usage is below.
Settings
" Highligt group name for local variable
" Default: 'Identifier'
let g:ruby_hl_lvar_hl_group = 'RubyLocalVariable'
" Auto enable and refresh highlight when text is changed. Useful but bit slow.
" Default: 1
let g:ruby_hl_lvar_auto_enable = 0
" If you wish to control the plugin manually, map these functions.
nmap <leader>he <Plug>(ruby_hl_lvar-enable)
nmap <leader>hd <Plug>(ruby_hl_lvar-disable)
nmap <leader>hr <Plug>(ruby_hl_lvar-refresh)Known bugs
- -Sometimes highlight contaminate other buffers- (hopefully fixed)