https://github.com/user-attachments/assets/395f18ee-1346-4ac2-8b5c-79597cffe995
[!WARNING] If using with nvim-autopairs, in
opts, ensure thatmap_bs = false.
{
"qwavies/smart-backspace.nvim"
}
use {
"qwavies/smart-backspace.nvim"
}
Plug "qwavies/smart-backspace.nvim"
If you want to lazy load Smart Backspace, you could set a event condition. For example, if you use lazy.nvim:
{
"qwavies/smart-backspace.nvim",
event = {"InsertEnter", "CmdlineEnter"}
}
Using lazy.nvim:
{
"qwavies/smart-backspace.nvim",
opts = {
enabled = true, -- enables/disables smart-backspace
silent = true, -- if set to false, it will send a notification if smart-backspace is toggled
disabled_filetypes = { -- filetypes to automatically disable smart-backspace
"py",
"hs",
"md",
"txt",
}
}
}
Using the :SmartBackspaceToggle command, smart-backspace can be toggled on/off.
If you want to set a keybind to toggle smart-backspace, you can implement the following into your neovim config:
vim.keymap.set("n", "<leader>bs", "<cmd>SmartBackspaceToggle<CR>", { desc = "Toggle Smart Backspace" })
:SmartBackspaceToggle commandmap_bs = false<C-BS> to use as a regular backspace