Quickest way to change a pair of parenthesis to brackets in vim

后端 未结 6 1140
野的像风
野的像风 2020-12-30 02:00

I am new to vim and in the process of discovering tons of interesting things that one can using this powerful editor.

One particular thing that I need to do very fr

6条回答
  •  孤独总比滥情好
    2020-12-30 02:50

    Without any plugin it can be done by deleting the content inside the parenthesis and yanking in the new bracket (from anywhere within the bracket):

    di(a[]P%2X
    

    Obviously more key that using surround but but not that many ;-)

    Note

    There is no need to remember the sequence of key but only to start by deleting the inside of the brackets. Then it's just normal vim fu.

提交回复
热议问题