So I am trying out javascript on vim. It is great that it automatically indents the braces for me when I close them etc.. But I was typing some JS and got into a bracket muddle.Here is what I had:angular.module('functionalities', []).directive(entering, function() {_}})I have put an underscore to represent where my cursor was when I started typing, in this case it was on this line in between the two braces : .directive(entering, function() {_} when I press enter the closing brace stays behind my cursor, is there a way to get it to go to the line underneath my cursor and indent correctly? like this:angular.module('functionalities', []).directive(entering, function() {    _  }})When I close braces, it automatically indents them in the right place for me, I am not sure if this due to a plugin I may have installed like Surround.vim but in this kind of situation where I insert text before the brace, it put me into a muddle with my brackets.Suggestions would be incredibly appreciated.
Forcing bracket to go under cursor
vimrc