diff --git a/home/.config/nvim/lua/plugins/which-key.lua b/home/.config/nvim/lua/plugins/which-key.lua index 0a65beac..616cca0d 100644 --- a/home/.config/nvim/lua/plugins/which-key.lua +++ b/home/.config/nvim/lua/plugins/which-key.lua @@ -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 = { "nohlsearch", "Turn off search highlight" }, b = { toggle_theme, "Toggle background between dark and light" }, + co = { close_other_buffers, "Close other buffers" }, }, { prefix = "" }) wk.register({