1

Trying to get up and running Vim + Rebar.

Separately they work but not together. What I want to achieve is to run eunit without leaving the Vim.

I guess this is doable with following plugin https://github.com/mbbx6spp/vim-rebar . Unfortunately is very poorly documented.

How do I run my tests quickly, see the output, code and once again.

All your feedback will be appreciated.

ruslander
  • 3,815
  • 4
  • 32
  • 34

3 Answers3

0

I don't know how to integrate rebar into vim, but perhaps you could try tmux? This works for me. In one window I keep opened vim, another window i use as compilation/attach session to erlang node.

danechkin
  • 1,306
  • 8
  • 15
0

One quick way to get out of Vim is to suspend it with Ctrl+z, run your commands, and then foreground it again with fg afterwards. Works at least on bash in Os X and Ubuntu Linux.

You can also run command line commands with :! <command name> directly from Vim, e.g. :! ls.

Yet another way is to use screen, with one window running vim and another still on the command line.

kjw0188
  • 3,625
  • 16
  • 28
0

The best solution I've found is to use a Makefile in my project. Since vim is capable of running shell commands, you can call make & have it use your makefile. Then map these shell commands to shortcuts of your choosing.

For example, my Makefile has the following:

test:
    $(REBAR) skip_deps=true eunit

In my .vimrc:

command MakeErlangTest !make test
nmap <leader>r :MakeErlangTest<CR>
Cody Poll
  • 7,690
  • 3
  • 27
  • 22