Nvim: add keybind to close other buffers

This commit is contained in:
Marko Korhonen 2024-07-03 14:04:18 +03:00
parent 758ffcfd08
commit 7066045d6e
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890

View file

@ -11,6 +11,10 @@ local function toggle_theme()
end
end
local function close_other_buffers()
vim.cmd('silent! execute "%bd|e#|bd#"')
end
--- @type LazyPluginSpec
return {
"folke/which-key.nvim",
@ -21,6 +25,7 @@ return {
wk.register({
h = { "<cmd>nohlsearch<cr>", "Turn off search highlight" },
b = { toggle_theme, "Toggle background between dark and light" },
co = { close_other_buffers, "Close other buffers" },
}, { prefix = "<leader>" })
wk.register({