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

前端 未结 7 697
抹茶落季
抹茶落季 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 03:10

    This works for a small number of files.

    vim ` find . -type f `

    :bufdo %s/pattern/replacement/gec | update

提交回复
热议问题