AutoClose


Ⅰ. 插件描述

Inserts matching bracket, paren, brace or quote

Ⅱ. 基本信息

创建日期:  2007-04-03
使用用户:  253
Github星:  60
插件作者:  Karl Guertin

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

There are very simple ways to insert a closing brace by setting up a few mappings. The problem with all these approaches is that they break undo, history or both. This script is my sixth attempt at correcting this problem and the first one that has worked in all scenarios.

Using this script, typing ( will result in (|), where | is the cursor position and the double backticks are just marking input. Typing a ) will move the cursor outside the parens. This moving outside works even in nested scenarios. Typing if(my_array['key results in if(my_array['key|']) and ) gets you if(my_array['key'])|.

The paired characters are: [, (, {, ", '

If you like this script, you should also check out surround.vim

添加新评论