Ⅰ. 插件描述
A dead-simple Vim plugin to automatically insert closing bracketsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tpenguinltg/closing-brackets'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tpenguinltg/closing-brackets'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tpenguinltg/closing-brackets'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tpenguinltg/vim-closing-brackets
Ⅳ. 文档说明
Closing Brackets
A dead-simple [Vim][] plugin to automatically insert the closing
bracket/brace/parenthesis based on Vim Tip #630. Requires Vim
7.0 or higher.
This plugin was written because the other solutions interfered with
[SCIM][] and were more complex than I needed.
Installation
Place the contents of this repo in your Vim runtime folder (~/.vim on
*nix systems or %USERPROFILE%\vimfiles on Windows) or use your
favorite Vim plugin manager.
Mappings
The following are insert-mode mappings provided by this plugin. ( may
be replaced with [ or {. The cursor position is denoted by |.
| Start | Input | Result | ||
|---|---|---|---|---|
( | `( | )` | ||
() | `( | )` | ||
(<BS> | ||||
<C-v>( | `( | ` | ||
(<Del> | `( | ` | ||
| ` | )` | ) | `) | ` |
| `) | ` | ) | `)) | ` |
<C-v>) | `) | ` |
There is additionally an extra mapping for {<CR>:
{
|
}The opened line will be indented according to your settings.
This plugin does not attempt to autoinsert quotes or do any smart
deletion of pairs.
License
As a collection of commands based on content from the Vim Tips wiki,
this plugin is licensed under the [Creative Commons Attribution-Share
Alike License 3.0 (Unported) (CC-BY-SA)][cc-by-sa].
Alternatives
The tip page has a list of plugins that offer more advanced
functionality.