Nvim: add keybind to close other buffers
This commit is contained in:
parent
758ffcfd08
commit
7066045d6e
1 changed files with 5 additions and 0 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue