How to run Erlang shell from inside Vim

I want to use Vim as an editor for my Erlang coding. I managed to install the plugin for Erlang in vim and I want to know if it is possible to compile the current buffer inside vim? In Emacs, for example, you can start the Erlang shell using the Ctrl C + Ctrl L key combination. So, is there an alternative in Vim to start the Erlang shell and then compile the current buffer?

+4
source share
2 answers

For a quick shell command from Vim, use :!command -a -b arg1 (for example :!ls -l , :!erl % ).

But Emacs is not Vim, they have different ideas behind both. Vim is just a text editor with extensions for programming, this is not the place for the terminal inside (as well as for Tetris and Mx doctor ).

Vim proponents refuse to add a full-blown implementation of the terminal to Vim itself (for more details see :help shell-window ).

If you still need an in-buffer wrapper, you can take a look at ConqueTerm , but it does not work without problems. I tried, but prefer to use tmux / screen to split my console screen state into windows.

+5
source

I also use the same vimerl plugin to develop erlang in vim. However, I had to make a small change to make some improvements to the compilation method for validation.

Once I made these changes, writing the file (for example using :w ) made vimerl compile this source file and put the warnings / errors in quickfix (exactly like :make if you have a Makefile in place).

FWIW, I also have the following configuration in vimrc :

 let g:erlangHighlightErrors = 1 let g:erlangHighlightBif = 1 let g:erlangCompletionDisplayDoc = 1 let g:erlangWranglerPath = "/usr/local/share/wrangler" let g:erlangRefactoring = 1 
0
source

All Articles