Awesome
vim-erlang-compiler
vim-erlang-compiler
is an Erlang syntax checking and compiler plugin for
Vim.
Table of Contents
Installation
<details> <summary>Vim's built-in package manager</summary>This is the recommended installation method if you use at least Vim 8 and you don't use another package manager.
Information about Vim's built-in package manager: :help packages
.
Installation steps:
-
Clone this repository (you can replace
foo
with the directory name of your choice):$ git clone https://github.com/vim-erlang/vim-erlang-compiler.git \ ~/.vim/pack/foo/start/vim-erlang-compiler
-
Restart Vim.
-
Generate help page (replace
foo
with the same directory name as above)::helptags ~/.vim/pack/foo/start/vim-erlang-compiler/doc
Information about Pathogen: Pathogen repository.
Installation steps:
-
Clone this repository:
$ git clone https://github.com/vim-erlang/vim-erlang-compiler.git \ ~/.vim/bundle/vim-erlang-compiler
-
Restart Vim.
-
Generate help page:
:Helptags
Information about Vundle: Vundle repository.
Installation steps:
-
Add
vim-erlang-compiler
to your plugin list in.vimrc
by inserting the line that starts withPlugin
:call vundle#begin() [...] Plugin 'vim-erlang/vim-erlang-compiler' [...] call vundle#end()
-
Restart Vim.
-
Run
:PluginInstall
.
Information about Vim-Plug: vim-plug repository.
Installation steps:
-
Add
vim-erlang-compiler
to your plugin list in.vimrc
by inserting the line that starts withPlug
:call plug#begin() [...] Plug 'vim-erlang/vim-erlang-compiler' [...] call plug#end()
-
Restart Vim.
-
Run
:PlugInstall
.
Documentation
- On the web: user documentation.
- Inside Vim:
:help vim-erlang-compiler
.
Troubleshooting
"I get compilation error"
If vim-erlang-compiler
shows you a compilation error even though there is no
compilation error when using your usual build tool, please follow these steps:
-
Compile your project with your usual build tool first (e.g.,
rebar compile
,rebar3 compile
ormake
), and then try again withvim-erlang-compiler
.Reason:
vim-erlang-compiler
needs theebin
directories andapp
files to be in place, because that is how Erlang itself finds applications when compiling the-include_lib
directives. -
Execute the following command from the terminal:
$ /path/to/vim-erlang-compiler/compiler/erlang_check.erl \ --verbose /path/to/myfile.erl
Reason:
-
vim-erlang-compiler
useserlang_check.erl
to compile the Erlang source files. The--verbose
option shows more information, which might help you to figure out the problem. -
If this produces the same error, we can be sure that the problem is on the Erlang side (not the Vim side).
-
-
Check the existing open issues on GitHub. Someone may have already reported the same problem.
-
If none of the above helps, open a new issue with the following information:
-
Which build system do you use?
rebar2
,rebar3
, Makefile, or nothing? -
What is the piece of code that cannot be compiled?
-
What is the verbose output of the
erlang_check.erl
script? (See step 2.) -
It helps if you can share the project which fails to compile (or a simplified version of it).
-
I modified g:erlang_make_options
but it didn't take effect
See the "Reloading" paragraph in the g:erlang_make_options_rules
section in
the user documentation.
Contributing
-
Please read the Contributing section of the
vim-erlang
README. -
If you modify
compiler/erlang_check.erl
, please:-
update the tests in the
vim-erlang
repository. -
also modify
vim-erlang-omnicomplete
(if you modify the "load build information" code block)
-