Ⅰ. 插件描述
A set of erlang plugins for VIM. This is not maintained, better use som modern fork of this!Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'oscarh/vimerl'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'oscarh/vimerl'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'oscarh/vimerl'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/oscarh/vimerl
Ⅳ. 文档说明
=== Vim Erlang plugin ===
Vim plugin for the programming language Erlang. The next features
are implemented:
- Syntax highlight
- Code folding
- Code completion (based on Module:module_info/1 to use the
Erlang introspection mechanism)
- Auto-indent
- QuickFix
- Wrangler support (the refactoring Erlang tool)
== Installation ==
Unix
- For local installation (one user only) copy the content of the
tarball to your ~/.vim directory - For global installation copy the content of the tarball to
your vim runtime directory (e.g. /usr/share/vim/vimX/)
- For local installation (one user only) copy the content of the
== Omni completion ==
Write the name of a module (e.g. `my_mod:') press CTRL-X CTRL-O to activate
the omni completion. The omni completion try to use the man pages to give
the definition for the standard functions. The omni completion try to compile
local modules, if it is possible, in order to call their Module:module_info/1.
The program `escript' is required, the standard Erlang installation
comes with it.
== Folding ==
To enable it just add to your vimrc `set foldenable'.
== Refactoring ==
Extract to new function:
Select the part of code you want to extract (or point something that
can be extracted) and press <Alt-r>e. You will be prompted to put the name
of new function. After that you can Preview, Confirm or Cancel this
refactoring. (Note: Preview is not currently supported).
Rename variable/function/module:
Point on variable/function that name should be changed and press:
<Alt-r>f for function
<Alt-r>v for variable
rename. To rename module, press <Alt-r>m anywere in the buffer.
Tuple function arguments:
Select or point on function arguments that should be changed into one tuple and press
<Alt-r>t.
== Settings ==
You can set various variables in your vimrc file to make the plugin behave
differently.
Syntax options:
The options expect a 0 value for disabling and a non-zero (e.g. 1) for enabling.
Highlight all Erlang bifs as keywords: (default: 0)
g:erlangHighlightBif
Folding options:
The option expects a 0 value for disabling and a non-zero (e.g. 1) for enabling.
Splitting functions if a new function head appears: (default: 0)
g:erlangFoldSplitFunction
Completion options:
The options expect a string with the path and an integer value like before.
Set the location of the Erlang man pages: (default: "/usr/lib/erlang/man")
g:erlangManPathEnable/disable using Erlang man pages in the code completion: (default: 1)
g:erlangCompletionDisplayDoc
More completion options:
The options expect a string as below is explained.
- Set the `grep' command to be use when scanning the man pages: (default: "grep")
g:erlangCompletionGrep Set the suffix of the man page names: (default: "")
g:erlangManSuffixOn Ubuntu, Erlang man pages are placed like this:
/ERLANG/PATH/man/man3/lists.3erl.gz ** So, you must set:let g:erlangCompletionGrep='zgrep'
let g:erlangManSuffix='erl.gz'In another systems, Erlang man pages are placed like this:
/ERLANG/PATH/man/man3/lists.3 ** In this case, use the default options value **
Compiler options:
The options expect a string with the path and an integer value like before.
Set the location of the `erlang_check_file.erl' script: (default: "~/.vim/compiler/erlang_check_file.erl")
g:erlangCheckFileEnable/disable highlighting erlang errors: (default 1)
g:erlangHighlightErrors- This option makes try to compile the current file each time it is saved
highlighting the errors.
- This option makes try to compile the current file each time it is saved
Refactoring options:
The option expects a string with the path.
Set the location of the Wrangler tool: (default: "/usr/share/wrangler/")
g:erlangWranglerPath