coc-pairs


Ⅰ. 插件描述

Auto pairs extension for coc.nvim

Ⅱ. 基本信息

创建日期:  2019-01-09
使用用户:  4
Github星:  79
插件作者:  neoclide

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/neoclide/coc-pairs

Ⅳ. 文档说明

# coc-pairs

Auto pair extension for coc.nvim.

Note you can use other vim auto pairs plugins with coc.nvim, it's a
simplified implementation to make auto pairs work like in VSCode.

Note b:coc_paires have renamed to b:coc_pairs

For enhanced <CR> experience, checkout :h coc#on_enter().

Tips

  • You should disable/remove other auto pair plugins for this extension work as expected.
  • When you type a paired character which is just the next character, it would just move to the right by one column.
  • When the previous content ends with two inserting characters, the characters would just be inserted without inserting the paired character. This makes inserting triple quotes easier.
  • ' only pairs when the character before is not a word character.
  • for < to insert paired >, the previous character should not be an empty space.

Install

In vim/neovim, run this command:

:CocInstall coc-pairs

Features

  • Insert pair characters automatically.
  • Buffer local pairs, ex: autocmd FileType tex let b:coc_pairs = [["$", "$"]]

Options

  • pairs.disableLanguages, list of language ids to disable this extension, default: [].
  • pairs.enableCharacters, list of enabled characters, default: ["(", "[", "{", "<", "'", "\"", "`"] .
  • pairs.enableBackspace, enable imap for backspace to remove paired characters,
    default: true, won't work when <bs> is already mapped.

To disable characters for a specified filetype, you can use b:coc_pairs_disabled, ex:

autocmd FileType markdown let b:coc_pairs_disabled = ['`']

License

MIT

添加新评论