Robert's Homepage

How to Grep and Replace in Neovim/Vim

#software development #neovim #how-to

You can use the Quickfix list in order to search and replace in Vim. You can use a plugin like telescope.nvim livegrep or basic vimgrep.

  1. Search via vimgrep.
  2. Use C-Q to open the Quickfix menu
  3. Use cdo s/<match>/<replacement>/g | update a. If you want you can add gc in order to to confirm each replacement