I usually find myself running pattern replacements on the results of vim-fugitive's Ggrep
:Ggrep someFunctionName
:cfdo %s/someFunctionName/someOtherName/g | update
And that works great but I can still see someFunctionName on the quickfix matches.
I know the quickfix gets those values from another function and it doesn't keep track of the actual files, but I'm wondering if there's a way to read the locations and refresh them with the new content.
I don't even need to worry about opening the buffers,
cfdoalready does that for me.I'll use your answer in this custom command:
command! UpdateQF call setqflist(map(getqflist(), 'extend(v:val, {"text":get(getbufline(v:val.bufnr, v:val.lnum),0)})'))That way I can do:
– davidmh Sep 21 '17 at 20:16:cfdo %s//something/g | update | UpdateQFUpdateQFinsidecfdo %s//something/g | update | UpdateQFis creating a new quickfix list for every file. I imagine this could make quickfix list history useless. May want to do it as a separate command after the executing your:cfdocommand. – Peter Rincker Sep 21 '17 at 20:56