How to replace text between quotes in vi

后端 未结 6 2021
无人共我
无人共我 2020-12-07 12:12

Say I have this line of code:

$query = \"SELECT * FROM table\";

Is there a command in vi/vim which can instantly delete everything between

6条回答
  •  猫巷女王i
    2020-12-07 12:25

    You can select between quotes and then delete (d), change (c) etc. using

    vi"
    

    Similarly, you can substitute braces, brackets, XML elements etc. thus:

    vi(
    vi{
    vit
    

    or to simply change/delete, do the corresponding di", ci" etc. Substituting a for i will encompassing the surrounding elements (so you mark or change the brackets and contents, for example)

提交回复
热议问题