Can I fix Groovy indenting in Vim? -


i trying use vim groovy code @ work. doesn't seem handle autoindents when semicolons not used. i've found few questions related ruby , javascript same issues, none of fixes find work me. have filetype plugin indent on in .vimrc, , not set cindent, autoindent, or smartindent. i've tried running setlocal nocindent nosmartindent in groovy buffer , reindenting file ggvg= in case there's plugin setting behind scenes, , still gets wrong.

for example, on small sample (from 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 indents after annotation, opening brace, , first line of function. .vimrc complex, can post link dotfiles if thinks help.

vim doesn't come indent script groovy. tries use standard indentation rules based on c. these rules use semicolons determine if line ended why line continuation indents on second line of function.

since vim doesn't include indent script can use groovyindent plugin. placed in ~/.vim/indent. need run dos2unix on groovy.vim since contains wrong line endings.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -