#vim-erlang_tools
https://github.com/fishcakez/vim-erlang_tools
Vim plugin to combine vim and tmux to add support for some erlang tools to vim.
Inspired by the vimux plugin. Currently erlc
, ct_run
, dialyzer
, eunit
and rebar
have some support.
The plugin works by using a ct hook or an eunit listener to produce identical
format to dialyzer -o outputfile
. This means all tools' output can be parsed
with the same parser.
If the vimerl plugin is present (and automatically located) its check on write is integrated.
##Basics
All tools (except eunit) work exactly the same as normal:
:Erlc = erlc
:Dialyzer = dialyzer
:Ctrun = ct_run
:Rebar = rebar
Eunit (may require R15B01+)
:Eunit [-dir directory | -module module [-test basic_test | generator_test_] | -cover | -surefire | -verbose | -logdir logs]
-logdir
option is the same as ct_run
.
Eunit is run using erl -s vet_eunit start
so all erl
options are supported
as well, e.g. -pa ebin
. Eunit support is in a very experimental stage.
The contents of the runner pane can be parsed (using tmux capture-pane
) for
errors, warnings or failed tests:
:Erlp
A quickfix list with all errors found (assuming the source files can be found) will be created. All relevant buffers will have location lists and signs updated to match the errors.
##erlc "clones"
:Erlv
- The same as Erlc but with warnings and +strong_validation:Erlt
- The same as Erlc but with -DTEST
##Run suite/test under cursor
:Ctrunsuite
, :Ctruncase
, :Eunitmodule
, :Eunittest
are (experimental)
commands to auto add options for the suite/module/test under cursor.
##History
Show last 10 runs of all tools:
:Erlh
Show last 10 runs of a particular tool (i.e. erlc
, erlt
, erlv
, dialyzer
,
ct_run
, eunit
or rebar
):
:Erlh erlc
Repeat last run of any tool:
:Erlr
Repeat last run of a particular tool:
:Erlr erlc
Repeat a particular run from history (use number from Erlh - 0 is last run):
:Erlr 1
Or for a particular tool:
:Erlr erlc 1
##Error lists
Parse contents of runner pane for errors and assign a name (default names are the same as for history) to the error list:
:Erlp named_run
Select a new error (quickfix) list from a selection of the previous (note that currently location lists will contain duplicates)
:Erls selection_name dialyzer ct_run
Delete any of previous error lists:
:Erld erlc dialyzer named_run selection_name
Location lists and signs will be automatically updated to contain all active error lists.
##Notes
- Requires tmux version 1.6 or greater
- Vim must be inside a tmux pane
- Experimental/work in progress/proof of concept/testing in production.. You have been warned
- Standard pathogen plugin
- Read source for settings to add to your .vimrc (everything has settings)