Ⅰ. 插件描述
Insert mode completion for text inside various brackets.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/bracketcomplete'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/bracketcomplete'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/bracketcomplete'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/BracketComplete
Ⅳ. 文档说明
DESCRIPTION
Frequently, text inside parentheses, be it a warning "(don't do this)" or
function arguments "(foo, bar, 42)" is repeated. This also applies to other
bracket delimiters, e.g. HTML tags "
" or arrays
"[1, 2, 3]".
This plugin provides a completion mapping that, when you realize you're typing
the same contents of a bracket-delimited text again, completes the entire text
inside the brackets from other matches in the buffer. The completion base
always contains the entire text between the cursor and the previous opening
bracket, so it doesn't matter how far you've already been into retyping this.
SEE ALSO
- Check out the CompleteHelper.vim plugin page (vimscript #3914) for a full
list of insert mode completions powered by it.
USAGE
In insert mode, invoke the completion via CTRL-X %.
You can then search forward and backward via CTRL-N / CTRL-P, as usual.
CTRL-X % Find matches for the text before the cursor, up to the
previous bracket ( [ { < on the current line, and
offer matches of the entire text inside the brackets,
like the i( i[ i{ i< text objects.
This also works for tag-blocks with the it text
object; "f|" will complete to "foo bar".