[erlang-questions] Vim Editor Erlang Indentation

Oscar Hellström oscar@REDACTED
Thu Jun 4 20:45:10 CEST 2009


Hi,

>From the experience I have with vim, you could hack the indentation
system to do whatever, but you might need to change some settings for
the editor as well while doing this. You can make the tab key behave
like it does in emacs erlang mode (which is to indent the line, not to
add a tab character or what I call "level of indentation") and well, you
can check which column the previous [ or { is on... but I don't know if
it is as easy as that. However, since I'm not interested in aligning
anything, I haven't looked in to it.

Felipe Kober wrote:
>
>     The largest difference is that emacs erlang mode tries to
>     *align* code, while the indentation script linked above will only
>     increase or decrease the *level of indentation* depending on what
>     tokens
>     were found.
>
>
> Oscar yes exactly the difference I encounter. And was not sure if
> problem is in vim limitations in making aligned code happen. Can vim
> hold alignment counters for each and still parse text rapidly? I'm
> sorry I don't know vim scripting.  The simple idea i can think is to
> make bracket (, [, { turn into tab-stop just as in word. Position of
> last bracket + 1 == spaces in next line.
>
>
> Felipe. 

Cheers

-- 
Oscar Hellström, oscar@REDACTED
Office: +44 20 7655 0337
Mobile: +44 798 45 44 773
Erlang Training and Consulting Ltd
http://www.erlang-consulting.com/



More information about the erlang-questions mailing list