Vim: changing/deleting up to the end of a “block”

前端 未结 4 2068
感动是毒
感动是毒 2021-02-01 07:11

When you have a block of text delimitated by brackets or quotes, you can use

ci\"
da(

and so on to change that block of text. But is there a wa

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-01 07:30

    I don't know of a generic way to do what you want but, assuming you are on the k in:

    The (quick (brown) fox) jumps over the lazy dog.
    
    • v2t) would select:

      (The quick (brown) fox) jumps over the lazy dog.
               ^^^^^^^^^^^^^
      

      If you don't want to count you can chain t) to expand your selection: vt)t) would first select:

      (The quick (brown) fox) jumps over the lazy dog.
               ^^^^^^^^
      

      then:

      (The quick (brown) fox) jumps over the lazy dog.
               ^^^^^^^^^^^^^
      
    • vT( would select:

      (The quick (brown) fox) jumps over the lazy dog.
       ^^^^^^^^^
      

提交回复
热议问题