Automatically insert a matching brace in Vim

前端 未结 18 2598
醉梦人生
醉梦人生 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条回答
  •  旧时难觅i
    2020-12-13 05:59

    I've always preferred something like what sublime text does where it appends the closing brace as the next character, so I added the following to my .vimrc:

    inoremap (  ()hli
    

    which moves the cursor to between the two braces.

提交回复
热议问题