hiPairs


Ⅰ. 插件描述

Highlights the pair surrounding the current cursor position.

Ⅱ. 基本信息

创建日期:  2016-01-25
使用用户:  5
Github星:  46
插件作者:  Yggdroot Chen

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

hiPairs

Highlights the pair surrounding the current cursor position.
This plugin is inspired by [matchParen.vim]

Screenshots

let g:hiPairs_enable_matchParen = 0

demo1

Default:

demo2

Installation

For Vundle user, just add Plugin 'Yggdroot/hiPairs' to your .vimrc.

Usage

  • :HiPairsDisable - Disable the plugin.
  • :HiPairsEnable   - Enable the plugin.
  • :HiPairsToggle   - Toggle the plugin.

Customization

You can use the following global variables to customize the plugin:

  • g:hiPairs_enable_matchParen

If the value is 0, the [matchParen.vim] will be disabled.

Default value is 1.

  • g:hiPairs_timeout

This plugin takes advantage of the [CursorMoved] autocommand event which is triggered very often,
so it may make your vim slow(if your computer is not good enough). This variable indicates the
time highlighting pairs costs during one movement of your cursor. If you encounter performance
issue, set this variable to a little value(measured in milliseconds).

Default value is 20 milliseconds.

  • g:hiPairs_insert_timeout

Same as g:hiPairs_timeout, but available in insert mode.

  • g:hiPairs_stopline_more

When hiPairs searching the pair, this variable tells it to search g:hiPairs_stopline_more lines more.

Default value is 20000.

  • g:hiPairs_hl_matchPair

This variable can be used to change the color of matched pair.

Default value is as below:

    let g:hiPairs_hl_matchPair = { 'term'    : 'underline,bold',
                \                  'cterm'   : 'bold',
                \                  'ctermfg' : '0',
                \                  'ctermbg' : '180',
                \                  'gui'     : 'bold',
                \                  'guifg'   : 'Black',
                \                  'guibg'   : '#D3B17D' }
  • g:hiPairs_hl_unmatchPair

This variable can be used to change the color of unmatched pair.

Default value is as below:

    let g:hiPairs_hl_unmatchPair = { 'term'    : 'underline,italic',
                \                    'cterm'   : 'italic',
                \                    'ctermfg' : '15',
                \                    'ctermbg' : '12',
                \                    'gui'     : 'italic',
                \                    'guifg'   : 'White',
                \                    'guibg'   : 'Red' }

License

MIT

添加新评论