vim-erlang-compiler is an Erlang syntax checking and compiler plugin for
Vim.
Vim's built-in package manager
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
foowith 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
foowith the same directory name as above)::helptags ~/.vim/pack/foo/start/vim-erlang-compiler/doc
Pathogen
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
Vundle
Information about Vundle: Vundle repository.
Installation steps:
-
Add
vim-erlang-compilerto your plugin list in.vimrcby inserting the line that starts withPlugin:call vundle#begin() [...] Plugin 'vim-erlang/vim-erlang-compiler' [...] call vundle#end() -
Restart Vim.
-
Run
:PluginInstall.
Vim-Plug
Information about Vim-Plug: vim-plug repository.
Installation steps:
-
Add
vim-erlang-compilerto your plugin list in.vimrcby inserting the line that starts withPlug:call plug#begin() [...] Plug 'vim-erlang/vim-erlang-compiler' [...] call plug#end() -
Restart Vim.
-
Run
:PlugInstall.
- On the web: user documentation.
- Inside Vim:
:help vim-erlang-compiler.
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 compileormake), and then try again withvim-erlang-compiler.Reason:
vim-erlang-compilerneeds theebindirectories andappfiles to be in place, because that is how Erlang itself finds applications when compiling the-include_libdirectives. -
Execute the following command from the terminal:
$ /path/to/vim-erlang-compiler/compiler/erlang_check.erl \ --verbose /path/to/myfile.erlReason:
-
vim-erlang-compileruseserlang_check.erlto compile the Erlang source files. The--verboseoption 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.erlscript? (See step 2.) -
It helps if you can share the project which fails to compile (or a simplified version of it).
-
See the "Reloading" paragraph in the g:erlang_make_options_rules section in
the user documentation.
-
Please read the Contributing section of the
vim-erlangREADME. -
If you modify
compiler/erlang_check.erl, please:-
update the tests in the
vim-erlangrepository. -
also modify
vim-erlang-omnicomplete(if you modify the "load build information" code block)
-