On Mi, 24 Jan 2024, Anirudh Singh Bhadauria wrote:
> Problem - Remapping crtl+backspace to delete previous word in insert mode!
>
> I am finding it really hard to do this, I have tried many combinations but it just doesn't work.
> (however, I was able to remap just backspace to delete the previoius word, but that's not practical) Therefore, If anybody has a solution, that would be great!
Are you trying this in a terminal or in the gui. Ctrl-Backspace may not
universally work.
>
> Remapping combinations that I tried so far,
> -- vim.keymap.set("i", "<C-BS>", "<C-W>", { desc = "delete whole word" })
> -- vim.keymap.set("i", "<C-W>", "<C-\\><C-O>dB", { noremap = true, silent = true })
> -- vim.keymap.set("i", "<C-W>", "<C-\\><C-O>db", { noremap = true, silent = true })
> -- vim.api.nvim_set_keymap('i', '<BS>', '<C-\\><C-O>db', { noremap = true, silent = true }) (remaps backspace to delete the previoius word)
This is neovim config. Are you using Neovim?
Thanks,
Christian
--
The fact that people are poor or discriminated against doesn't necessarily
endow them with any special qualities of justice, nobility, charity or
compassion.
-- Saul Alinsky