How do I send Telescope results to the quickfix list for bulk editing?
Answer
<C-q> (Telescope)
Explanation
While inside any Telescope picker, pressing <C-q> sends all current results to the quickfix list and closes the picker. You can then use :cdo or :cfdo to apply commands across every matched file — making it a powerful pipeline for project-wide refactoring.
For finer control, <M-q> (Alt+q) sends only the multi-selected entries (marked with <Tab>) to the quickfix list instead of all results.
How it works
- Open a Telescope picker (e.g.,
:Telescope live_grep) - Type a search pattern to filter results
- Optionally use
<Tab>to manually select specific entries - Press
<C-q>to send all results (or<M-q>for selected only) to quickfix - Run a command across every quickfix entry:
:cfdo s/old_api/new_api/g | update
Example
Project-wide rename of a function using Telescope + quickfix:
" 1. Find all usages
:Telescope live_grep
" type: handleUserLogin
" 2. In Telescope, press <C-q> to send all matches to quickfix
" 3. Replace across every matched file
:cfdo %s/handleUserLogin/handleAuth/g | update
Tips
:copento reopen the quickfix list at any time after closing Telescope:cdo {cmd}runs on each entry (one per match line);:cfdo {cmd}runs once per file — prefer:cfdowith%sto avoid partial replacements- The default
<C-q>binding can be remapped in your Telescope config underdefaults.mappings.i['<C-q>'] - Works with all pickers:
find_files,grep_string,lsp_references, etc.