开发者

vim imap trouble for automatically closing quotations

I managed to get auto closing braces and parentheses right:

imap { {<return><return>}<Esc>kcc
imap ( ()<Esc>i

However, quotation can't be written like parentheses. If I write it like this:

imap " ""<Esc>i

it goes into an infinite loop. Why does this happen?

I then wrote quotations like this:

imap " "<Esc>xPpi

This one too has a problem. It eats up a character t开发者_开发知识库o the left of insertion. I fiddled around with it, but could not work out how to get the mapping right. Can someone help please?


Try this:

inoremap " ""<Esc>i

This way it will not apply mappings to the result of mapping (no resursion)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜