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.
Some default key mappings and commands
- Existing from Terminal:
<C-\><C-n> - List buffers:
:buffers, use:b<number>to switch to target buffer and:bd<number>to delete target buffer. - Managing pane:
:vsor:spto split.<C-w>H, <C-w>J, <C-w>K, <C-w>Lto move pane. - Number increment/decrement: Increase/Decrease highlighted number by one:
<C-a>/<C-x>. Increase/Decrease visual blocked number sequentially:g<C-a>/g<C-x>.
Last updated: 2026-05-27
Initial edit: 2026-03-28