I am trying to use Vim for some Groovy code at work. It doesn't seem to handle autoindents well when semicolons are not used. I've found a few questions related to Ruby and JavaScript with the same issues, but none of the fixes I find work for me. I do have filetype plugin indent on
in my .vimrc, and do not set cindent
, autoindent
, or smartindent
. I've tried running setlocal nocindent nosmartindent
in a Groovy buffer and reindenting the file with ggVG=
just in case there's a plugin setting those behind the scenes, and it still always gets it wrong.
For example, I get this on a small sample (from a personal libGDX sandbox app I'm writing in Groovy)
@Override
void render () {
Gdx.gl.glClearColor(0.75f, 0.75f, 0.75f, 1)
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
batch.begin()
batch.draw(img, 0, 0)
font.draw(batch, "Testing", 300, 400)
batch.end()
}
Notice the extra indents after the annotation, the opening brace, and the first line of the function. My .vimrc is fairly complex, but I can post a link to my dotfiles if anyone thinks that will help.