Skip to main content

How to Find and Replace Project-wide in Vim

· One min read

0. Requirements

  • fzf and fzf.vim are installed
  • Rg or ag is installed
  • set alt/option to ESC+

1. Usage

  1. :Rg pattern : search pattern in project
  2. <tab> to select, <shift>-<tab> to deselect to quickfix list
  3. <enter> to pop quickfix list
  4. :cfdo %s/pattern/string/g to replace all instances in quickfix list

2. Reference