How to do search & replace with ack in vim?

后端 未结 5 487
天命终不由人
天命终不由人 2020-12-07 08:43

I am using the Ack plugin in Vim, which helps me to quickly search for strings in my project. However, sometimes I want to replace all or some occurrences of the found strin

5条回答
  •  不知归路
    2020-12-07 09:24

    Now, Vim has this new command cdo that will run the given command to each line of the quickfix list.

    So you can use

    :Ack pattern
    :cdo s/pattern/newpattern/g
    

提交回复
热议问题