and you want to update all the references across all files of a project, you can do this with quickfix + :cdo:
First, grep for the old function name in the src/ directory.
:grep"add3("-R src/
This will load all results into a quickfix list.
You can see this list by typing:
:copen
Now, you can run another vim command to simply update all the references in your quickfix list in one go:
:cdo s/add3\(/add\(3,\ /g|update
This is a simple subsitituion which replaces all references to add3( to add(3, and saves the changes.
For more information about quickfix lists and what you can do with them, check out the vim docs and feel free to search "vim quickfix" online (lots of good blog posts & youtube videos dive into this feature of vim).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Say you've changed a function signature, like:
and you want to update all the references across all files of a project, you can do this with quickfix +
:cdo
:src/
directory.This will load all results into a quickfix list.
You can see this list by typing:
This is a simple subsitituion which replaces all references to
add3(
toadd(3,
and saves the changes.For more information about quickfix lists and what you can do with them, check out the vim docs and feel free to search "vim quickfix" online (lots of good blog posts & youtube videos dive into this feature of vim).