rainbow_parentheses.vim


Ⅰ. 插件描述

Rainbow Parentheses for Vim

Ⅱ. 基本信息

创建日期:  2011-10-12
使用用户:  30
Github星:  37
插件作者:  Evan Huus

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'eapache/rainbow-parentheses-vim-sweeter-than-fiction'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'eapache/rainbow-parentheses-vim-sweeter-than-fiction'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'eapache/rainbow-parentheses-vim-sweeter-than-fiction'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Better Rainbow Parentheses

This repo is mostly unmaintained - I switched to using
https://github.com/luochen1990/rainbow instead and generally suggest you do too.

Originally forked from https://github.com/kien/rainbow_parentheses.vim since
that was really unmaintained and needed some fixes.

Installation

Using pathogen.vim:

cd ~/.vim/bundle
git clone git://github.com/eapache/rainbow_parentheses.vim.git

Options:

The colours used; the outermost pair is coloured with the last colour in the
list, the next-outermost with the second-last colour, etc. The first element of
each entry is the terminal colour, the second element is the GUI (gvim) colour.

let g:rbpt_colorpairs = [
    \ ['red',         'RoyalBlue3'],
    \ ['brown',       'SeaGreen3'],
    \ ['blue',        'DarkOrchid3'],
    \ ['gray',        'firebrick3'],
    \ ['green',       'RoyalBlue3'],
    \ ['magenta',     'SeaGreen3'],
    \ ['cyan',        'DarkOrchid3'],
    \ ['darkred',     'firebrick3'],
    \ ['brown',       'RoyalBlue3'],
    \ ['darkblue',    'DarkOrchid3'],
    \ ['gray',        'firebrick3'],
    \ ['darkgreen',   'RoyalBlue3'],
    \ ['darkmagenta', 'SeaGreen3'],
    \ ['darkcyan',    'DarkOrchid3'],
    \ ['red',         'firebrick3'],
    \ ]

How deep to colour (repeating the colour list if necessary) before giving up;
limited for performance reasons.

let g:rbpt_max = 15
let g:rbpt_loadcmd_toggle = 0

Also bold parenthese to make the colours stand out more.

let g:bold_parentheses = 1      " Default on

Commands:

:RainbowParenthesesToggle       " Toggle it on/off
:RainbowParenthesesLoadRound    " (), the default when toggling
:RainbowParenthesesLoadSquare   " []
:RainbowParenthesesLoadBraces   " {}
:RainbowParenthesesLoadChevrons " <>

Always On:

Add the following to your ~/.vimrc to always use Rainbow Parenthesis

au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces

Or just use RainbowParenthesesToggleAll. You may need to put syntax on in
your .vimrc before you enable rainbow parentheses.

添加新评论