1

Possible Duplicate:
Make Vim Curly Braces, Square Braces, Parens act like Textmate

I'm coming from textmate and I'm really really loving vim.

One part I liked about textmate was when editing css you would type

.title {

and it would auto complete the brackets to this (where | is the cursor)...

.title {|}

THen you would hit enter and it turns to

.title {
    |
}   

I have the "Autoclose" plugin but when you hit enter it just brings the } with it and looks like a mess.

Community
  • 1
  • 1
Tallboy
  • 12,847
  • 13
  • 82
  • 173

2 Answers2

0

You can try an imap:

:imap { {<Esc>o}<Esc>ko
uzsolt
  • 5,832
  • 2
  • 20
  • 32
0

There is a nice Vim plugin, snipMate, that provides auto-completion and maybe can attend your needs.

By default it works for bigger patterns, as the entire tag .title in your example. Maybe you could insert a snippet for '{'.

mMontu
  • 8,983
  • 4
  • 38
  • 53