My Neovim Tips
March 28, 2026
nvim
Find all occurrences and replace with telescope.nvim
Setup telescope.nvim for keymapping:
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>F', builtin.live_grep, { desc = 'Telescope live grep' })
-- Or setup with which-key.nvim
local status_ok, which_key = pcall(require, "which-key")
if not status_ok then
return
end
which_key.add({
{ "<leader>F", "<cmd>Telescope live_grep<cr>", desc = "Live grep", hidden = true },
})
- Run
<leader>Fto find all occurrences. - Use
<C-q>to send all items into quickfix list (qflist). For default mapping, see this. - Use
:cdo s/foo/bar/gcto replace all occurrences in the quickfix list.
Last updated: 2026-03-28
Initial edit: 2026-03-28