开发者

vim imap trouble for automatically closing quotations

开发者 https://www.devze.com 2023-02-09 10:24 出处:网络
I managed to get auto closing braces and parentheses right: imap { {<return><return>}<Esc>kcc

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

精彩评论

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