Automatically insert a matching brace in Vim

前端 未结 18 2553
醉梦人生
醉梦人生 2020-12-13 05:23

I spend way too much time fumbling around because Vim doesn\'t handle closing braces like most IDEs do. Here\'s what I want to happen:

Type this:

         


        
18条回答
  •  暖寄归人
    2020-12-13 06:07

    Finally I found out there is no need for plugin but rather this works perfect for me:

    inoremap { {}ha
    inoremap ( ()ha
    inoremap [ []ha
    inoremap " ""ha
    inoremap ' ''ha
    inoremap ` ``ha
    

提交回复
热议问题