开发者

how to set vim autoclose bracket without blank?

I'm using gvim7.3 on windows7. When I type "[" or "(" or "{" vim will autoclose them like: "[ | ]" "( | )" "{ | }", "|" is the cursor position. But I 开发者_如何学运维want it autoclose without blanks like: "[|]" "(|)" "{|}", how to set the vim to do this? Thanks.


AutoClose.vim will close braces without putting spaces around the cursor.


Just use

imap [ []<LEFT>
imap ( ()<LEFT>
imap { {}<LEFT>
imap < <><LEFT>

in vimrc. But make sure that there's no spaces after these strings like

imap [ []<LEFT>_

It makes Vim insert additional spaces between brackets.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜