pyparens.nvim


Ⅰ. 插件描述

Neovim/vim8 plugin to highlight surrounding braces.

Ⅱ. 基本信息

创建日期:  2017-08-08
使用用户:  1
Github星:  10
插件作者:  djdt

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# pyparens.nvim
Neovim / vim8 plugin to highlight surrounding braces / scope.

As it works using python regexes you can highlight any type of pair that you want.

Column highlighting can be enabled to easily identify the scope over multiple lines.

Usage image parens
Usage image words

Installation

Using vim-plug:

Plug 'djdt/pyparens.nvim'

Be sure to :UpdateRemotePlugins if using Neovim, this can be acheived using Plug:

Plug 'djdt/pyparens.nvim', {do: ':UpdateRemotePlugins'}

Options

To set the highlight group use g:pyparens_hl_group:

let g:pyparens_hl_group = 'MatchParen'

The leftmost column of the current block will be highlighted if g:pyparens_hl_col_group is set.

Use g:pyparens_pairs to set the types of pairs highlighted.
Each pair is a list of python regexes for opening and closing words.

g:pyparens_ft_pairs can be used to set additional pairs used only for specific filetypes.

As an example:

let g:pyparens_pairs = [[ '\{', '\}' ], [ '\(', '\)' ], [ '\[', '\]' ]]

let g:pyparens_ft_pairs = {
        \ 'cpp': [['(?<!\<)\<(?!\<)', '\>']],
        \ 'vim': [['\bif\b', '\bendif\b', '\bfor\b', '\bendfor\b']]
        \}

Inspired by matchparenalways.vim and MatchTagAlways.

添加新评论