Ⅰ. 插件描述
better code completion for vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/ucompleteme'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/ucompleteme'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/ucompleteme'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/ucompleteme
Ⅳ. 文档说明
Overview
On Github: https://github.com/aaronj1335/ucompleteme
ucompleteme is a Vim plugin for insert-mode completion. It combines the
results of omni-completion with its own "proximity" completion function.
ucompleteme attempts to provide completion options intelligently, so the user
doesn't have to think about what kind of code completion to use
(omni-completion,
current file completion,
etc.). Plugins like
SuperTab provide a
means to easily switch between different completion methods, but they aren't as
opinionated about building the list of matches for the user.
The philosophy behind ucompleteme is that instead of having to think about
which completion type is best, the completion funciton should make an educated
guess by first running the omni-completion function (where available), then
finding matches within the current buffer, then other buffers of the same
filetype, and finally the remaining buffers.
Details
ucompleteme provides a user-defined completion function.
By default it re-maps <tab> in insert mode to use this function. If an
omnifuc is defined, ucompletme starts by populating the list with those
results first and giving the user a chance to interact. After that it will run
its own "proximity" completion function that searches each line of a buffer
progressively further from the cursor. The proximity search is run on the
current buffer, and then the other buffers of the same filetype, and finally
the remaining open buffers.
Options
- g:ucompleteme_map_tab: if this is set to 1,
ucompletemewill re-map
<tab>in insert mode - g:max_lines_for_omnifunc: omni-completion functions can be slow for
large files. this determines how large a file can be beforeucompleteme
will not skip using omni-completion and just use keyword completion.