There are two 'types' to be aware of with a quickfix window:
- entry: the actual line content (e.g.
:grep foowill show a specific line that matched within a file). - file: the actual file itself (e.g. the path to the file that contained the match).
If you want to replace content in a file you need to choose whether you want to apply the change via the quickfix 'entry' or via the 'file' as a whole.
This is best demonstrated by examples...
To execute a substitution for every 'entry' listed in the quickfix window use cdo:
:cdo s/v2/v3 | update
To execute a macro for every 'file' listed in the quickfix window use cfdo:
:cfdo execute "norm @q" | update
Awesome notes π Now I understand the difference between cdo and cfdo.
Thank you