How do I add another project-wide pattern search without replacing my current quickfix results?
Answer
:vimgrepadd /pattern/j **/*<CR>
Explanation
When you are investigating code, you often need to collect several related patterns before deciding what to edit. Plain :vimgrep replaces the quickfix list each time, which discards previous findings. :vimgrepadd appends new matches to the existing list, letting you build a combined result set incrementally.
How it works
:vimgrepaddruns a Vim regex search over files and adds matches to quickfix/pattern/is the Vim regex to search forjkeeps your cursor location stable while populating results**/*recursively expands files from the current working directory
After appending, open quickfix (:copen) and navigate normally with :cnext and :cprev.
Example
First search for one pattern:
:vimgrep /TODO/j **/*
Then append another related pattern without losing previous entries:
:vimgrepadd /FIXME/j **/*
Now quickfix contains matches for both TODO and FIXME, so you can triage them in one pass.
Tips
- Use
:cexpr []to clear quickfix when you want to start a fresh collection - Add
:cdoor:cfdoonce your list is stable and ready for bulk changes - If file globs are too broad, use
:argsfirst and run:vimgrepaddover the argument list