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

How do I do a live fuzzy search across all files with Telescope in Neovim?

Answer

:Telescope live_grep

Explanation

Telescope's live_grep picker provides real-time regex search across your entire project as you type. It uses ripgrep under the hood for blazing speed, and the results update instantly with each keystroke.

Setup

Requires Neovim 0.9+ and these plugins:

-- Using lazy.nvim
{
  'nvim-telescope/telescope.nvim',
  dependencies = { 'nvim-lua/plenary.nvim' },
}

Also install ripgrep on your system.

Key commands

:Telescope live_grep     " Search file contents across the project
:Telescope find_files    " Fuzzy find files by name
:Telescope buffers       " Search open buffers
:Telescope help_tags     " Search Vim help
:Telescope oldfiles      " Recently opened files
:Telescope grep_string   " Search for word under cursor

Inside the picker

Key Action
<C-n> / <C-p> Next / previous result
<CR> Open file
<C-x> Open in horizontal split
<C-v> Open in vertical split
<C-t> Open in new tab
<C-q> Send all results to quickfix
<Esc> Close picker

Recommended mappings

local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files)
vim.keymap.set('n', '<leader>fg', builtin.live_grep)
vim.keymap.set('n', '<leader>fb', builtin.buffers)
vim.keymap.set('n', '<leader>fs', builtin.grep_string)

Tips

  • <C-q> sends results to quickfix — pair with :cdo for project-wide batch editing
  • Install telescope-fzf-native extension for faster sorting
  • Use live_grep's glob_pattern option to filter by file type
  • Telescope respects .gitignore by default
  • With 18k+ GitHub stars, Telescope is the most popular Neovim plugin

Next

How do I run the same command across all windows, buffers, or tabs?