Ⅰ. 插件描述
vim plugin for erlang code auto-completationⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'youthy/vimerl-complete'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'youthy/vimerl-complete'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'youthy/vimerl-complete'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/youthy/vimerl-complete
Ⅳ. 文档说明
# vimerl-complete
Vim plugin for erlang code auto-completation

Require
Install
Then edit .vimrc in your $HOME path, add
Plugin 'youthy/vimerl-complete'after other plugins. Then type
:PluginInstallin vim to install.
Usage
- This plugin parse offical docs on erldocs. please download a version which you need and extract into your
$HOME directory. like/home/youthy/docs-18.3. - Then run below command in vim
:EcompleteGen 18.3to generate tags for completation. Yon need run this command only once unless you change your erlang version
(18.3 is the version I used. It can be like R15B01 etc.)
If you don't want to download erldocs, You can also type
:EcompleteGento gen tags from erlang source files(It takes maybe a minute). You must ensure you have .erl src files. To find them in code:lib_dir() ++ "*/src" directory.
I recommand you use kerl
this idea is from
vim-erlang-omnicomplete
By default, It will automaticlly display module functions after you type module:.
And the functions only include exported functions. You can change default settings by add
" set this value to 0 to disable the auto completation
let g:vimerl_complete_auto = 0
" set this value to 0 to enable display all module functions include not exported
let g:vimerl_complete_only_export = 0into your .vimrc file to change the default settings.
If you disable auto-display, then you can Use
<Tab>to list completation.
Example
module:
when you type a module name and a: it will displays functions exported or not in the module
depends your settings. Module can be offical module like lists, ets or user module whose .erl file in the src/ parent path, recursively.
like/home/youthy/erlang_project/src, it will match the module.erl in /home/youthy/erlang_project recursively.
module:funname
same as above,but display matches only match funname.
singleword
when there no : before cursor, it will display modules which match the singleword, and functions in erlang module
which match, and localfunctions.
**Up to now, this plugin conflicts with YouCompleteMe or neocomplete, becase they force use completeopt-=longest
and under this situation, plugin always select the first match in display menu.It annoys. But I haven't find
a beautiful solution**