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.
You can try an imap:
:imap { {<Esc>o}<Esc>ko
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 '{'.
精彩评论