[erlang-questions] Is there any erlang code formatting tool?

Csaba Hoch csaba.hoch@REDACTED
Fri Feb 13 16:10:33 CET 2009


Liu Yubao wrote:
> I prefer Vim to edit and Emacs to format erlang code but
> switching between two editors is very inconvenient. Is
> there any erlang code formatting tool? Or how can I use emacs
> to format erlang source files in batch?

Hi,

If you put this in your .vimrc, you can ask Emacs to indent the file
that you are editing by typing :IndentErl.

command! IndentErl call IndentErlangWithEmacs()

function! IndentErlangWithEmacs()
    exec '!emacs --eval "(progn (find-file \"' . expand('%:p') . '\")' .
       \ '(erlang-indent-current-buffer) (save-buffer) '.
       \ '(save-buffers-kill-emacs))"'
endfunction

Csaba



More information about the erlang-questions mailing list