How do I make vim indent java annotations correctly?

Posted by wds on Stack Overflow See other posts from Stack Overflow or by wds
Published on 2008-10-14T12:24:41Z Indexed on 2010/05/15 20:14 UTC
Read the original article Hit count: 167

Filed under:
|
|
|

When indenting java code with annotations, vim insists on indenting like this:

@Test
    public void ...

I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not sure if I can use that together with regular cindent.

edit: The filetype plugin was already turned on I just got a bit confused about indenting plugins. The accepted answer may be a bit hackish but works for me as well.

© Stack Overflow or respective owner

Related posts about vim

Related posts about java