Ⅰ. 插件描述
Erlang indentation and syntax for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'hcs42/vim-erlang-runtime'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'hcs42/vim-erlang-runtime'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'hcs42/vim-erlang-runtime'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/hcs42/vim-erlang-runtime
Ⅳ. 文档说明
# Erlang indentation and syntax for Vim
This is the Erlang indentation and syntax that is shipped with Vim (from Vim 7.4).
Installation
Method 1
Clone this repository:
$ mkdir -p ~/.vim/bundle $ cd ~/.vim/bundle $ git clone https://github.com/hcs42/vim-erlang-runtimeAdd the repository path to
runtimepathin your.vimrc::set runtimepath^=~/.vim/bundle/vim-erlang-runtime/
Method 2
- Copy
syntax/erlang.viminto~/.vim/syntax/. - Copy
indent/erlang.viminto~/.vim/indent/.
Development and testing
This section is relevant only if you want to be involved in the development of
the script.
The indentation script can be tested in the following way:
- Copy
syntax/erlang.viminto~/syntax. - Open
test_indent.erlin Vim from this directory. (test_indent.erlalways
shows how the Erlang code is indented by the script – not how it should be.) - Source
helper.vim(:source helper.vim) - Press F1 to load the new indentation (
indent/erlang.vim). - Press F3 to reindent the current line. Press shift-F3 to print a log.
- Press F4 to reindent the current buffer.
- Press F5 to show the tokens of the current line.
Note:
- When the indentation scripts detects a syntax error in test mode (i.e. when it
was loaded withF1fromhelper.vim), it indents the line to column 40
instead of leaving it as it is. This behavior is useful for testing.