context_complete.vim


Ⅰ. 插件描述

Context sensitive word completion

Ⅱ. 基本信息

创建日期:  2005-01-24
使用用户:  1
Github星:  1
插件作者:  David Larson

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

The focus of this script is to provide context-sensitive word completion - taking advantage of the popular ctags utility and Vim's built-in perl features.

Suppose you have an instance of an object (o), and you've typed:

o.set_

While you are still in insert mode, press CTRL-J, and this script will then look up the first member of that object that starts with "set_" and complete it for you, like this:

o.set_range(integer max, integer min)

If this isn't the completion that you want, then press CTRL-J again for the next member that starts with "set_":

o.set_name(string name)

and again for the next one:

o.set_value

If you've gone too far then you can go back with CTRL-K. After each completion you are left in insert mode - so you can just continue typing when you've found the one you want.

The object can also be replaced with a struct, class, 'this', or 'super'.

Completions can also be made after the open parentheses to complete the list of parameters:

o.set_range(<c-j>

Or after the function:

o.get_name().compar<c-j>

Pressing CTRL-S will skip through the function parameters, visually selecting each in turn - useful for filling in the parameters after completing a function.

添加新评论