Replacing quote marks around strings in Vim?

前端 未结 8 1599
遇见更好的自我
遇见更好的自我 2021-01-30 11:09

I have something akin to and need to change the single quotation marks to double quotation marks. I tried :s/\\\'.*\\\'/\

8条回答
  •  星月不相逢
    2021-01-30 11:45

    You need to use groupings:

    :s/\'\(.*\)\'/\"\1\"
    

    This way argument 1 (ie, \1) will correspond to whatever is delimited by \( and \).

提交回复
热议问题