How to quickly remove a pair of parentheses, brackets, or braces in Vim?

One can take advantage of the text objects that are built in into Vim
(see :help text-objects). The desired edit can be stated as a
sequence of the following three actions.

  1. Cut the text inside the square brackets:

     di[
    
  2. Select the (empty) square brackets:

     va[
    

    Alternatively, you can just select the character under the
    cursor and the one to the left of it, because the command
    from step 1 always puts the cursor on the closing bracket:

     vh
    
  3. Paste the cut text over the selected brackets:

     p
    

Altogether, it gives us the following sequence of Normal-mode commands:

di[va[p

or, when the alternative form of step 2 is used:

di[vhp

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)