In VimL, you can map the {
to do exactly as you wish:
inoremap { {<CR>}<Esc>ko
depending on your autoindent setup, you may want to add a <BS>
after <CR>
.
For a more complete solution, I’d suggest you take a look at Luc Hermitte’s vim plugins. They’ve never failed me so far.