I have electric-pair-mode
on (which isn't really particularly relevant, as this could apply to any auto-pairing mode or even manual parens), but in a nutshell, I'd like it so that in the case I have:
function foo() {|}
(where |
is the mark)
If I press enter, I would like to have it automatically go to
function foo() {
|
}
It would also mean that
function foo(|) {}
would become
function foo(
|
){}
I already have things to take care of the indentation, but I'm not sure how to say "if I'm inside any empty pair of matched parenthesis, when I press return, actually insert two new lines and put me at the first one".
Thanks!