Automatically insert a matching brace in Vim

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)