ervandew / matchem

Vim plugin to auto add closing quotes, parens, brackets, curlies, etc.
21 stars 1 forks source link

Closing brace does not return to correct indent after <CR> #11

Open cmcginty opened 8 years ago

cmcginty commented 8 years ago

When I type test {<CR> in a Groovy file, I get

test {
  }

but I was expecting

test {
}
ervandew commented 8 years ago

I can't reproduce it, so that's probably due to some ftplugin you have installed. You can use :scriptnames to see what's been loaded and try moving potential ftplugins, etc out of the way to see if the issue goes away.

cmcginty commented 8 years ago

Do you have a groovy.vim file in your global ftplugin/ or indent/ directories? On my system (Mint 17.3) I only only a syntax/groovy.vim file.

cmcginty commented 8 years ago

Since my OS doesn't include both a ftplugin/groovy.vim or indent/groovy.vim I resolved this with:

  1. Install the indent plugin from https://github.com/vim-scripts/groovyindent-unix
  2. Create a new .vim/ftplugin/groovy.vim with the following line:

    runtime! ftplugin/java.vim