vimtricks.wiki Concise Vim tricks, one at a time.

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

  1. Open a Telescope picker (e.g., :Telescope live_grep)
  2. Type a search pattern to filter results
  3. Optionally use <Tab> to manually select specific entries
  4. Press <C-q> to send all results (or <M-q> for selected only) to quickfix
  5. 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

  • :copen to 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 :cfdo with %s to avoid partial replacements
  • The default <C-q> binding can be remapped in your Telescope config under defaults.mappings.i['<C-q>']
  • Works with all pickers: find_files, grep_string, lsp_references, etc.

Next

How do I match a pattern only when it is preceded or followed by another pattern, without including that context in the match?