I don't know if this solves your problem completely, but if this is a one-time operation, you can try regular expressions:
:%s/^\(\s*\)\(.*)\)\s*{\s*$/\1\2^M\1{/
Note that ^M is a control character that is usually generated (depending on your terminal) by pressing CTRL-V and then ENTER .
EDIT . As pointed out in the comments by Jay and Zyx, \r is the best way to insert a line break in a replaced string. I did not know about this, thank you very much for the hint.
source share