Wednesday, January 24, 2024

Remapping crtl+backspace to delete previous word in insert mode!

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! 

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)

Thank you, 
Anirudh

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/79326a3e-f12a-46fe-beff-7cb7d70bd288n%40googlegroups.com.

No comments: