How can I search and replace recursively in a directory in Vim?

前端 未结 7 710
抹茶落季
抹茶落季 2021-01-30 02:44

I found out about Vim\'s substitute command...

:%s/replaceme/replacement/gi

And vimgrep...

:vimgrep  /findme/gj  project/**/*.r         


        
7条回答
  •  感情败类
    2021-01-30 02:57

    args and argdo should do what you need, e.g.

    :args spec/javascripts/**/*.* 
    :argdo %s/foo/bar/g
    

    See this page.

提交回复
热议问题