Indent Highlight


Ⅰ. 插件描述

Yet another indentation (scope) highlighting

Ⅱ. 基本信息

创建日期:  2008-07-26
使用用户:  2
Github星:  1
插件作者:  Andrey Tsiporukha

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

This plugin provides a function that will highlight (or remove
highlighting ) of the current scope and parent scope based on difference in

  1. It can be very usefull for languages that use indentation to
  2. the scope ( python, rubby, etc. )

I wrote this script so that I could quickly restore visual stack when
coding in python. So for python I created the following mapping in my vimrc:

map <silent> <Leader>ih :call IHighlight( 1, "^[[:space:]]*\(def\\|class\)[[:space:]]\+" )<CR>
map <silent> <Leader>is :call IHighlight( 0, "^[[:space:]]*\(def\\|class\)[[:space:]]\+" )<CR>

which allows me by entering ih (or is) to highlihgt current scope along
with the parent scope and than by entering ih (or is) again remove the
highlighting

the difference between ih and is is that
the first one (ih) will turn off all syntax highlighting untill indentation highlighting is active
the syntax highlighting will be turned back on when you enter ih again turning the indentation highlighting off
the second one (is) will apply indentation highlighting on top of existing syntax highlighting

one can extend this functionality and provide bindings for movement keys so
that highlighting follows the cursor position

添加新评论