From 3fb82ca44e83be42d5a166c80b245f3938ffffb9 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 11 Nov 2024 15:11:40 -0600 Subject: [PATCH] refactor(nvim): replace `bufdelete.nvim` with `snacks.nvim` bufdelete --- .../nvim/lua/plugins/configs/bufdelete.lua | 25 ----------------- .../nvim/lua/plugins/configs/snacks.lua | 27 ++++++++++++++++++- 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 users/price/dots/.config/nvim/lua/plugins/configs/bufdelete.lua diff --git a/users/price/dots/.config/nvim/lua/plugins/configs/bufdelete.lua b/users/price/dots/.config/nvim/lua/plugins/configs/bufdelete.lua deleted file mode 100644 index 318f18c1..00000000 --- a/users/price/dots/.config/nvim/lua/plugins/configs/bufdelete.lua +++ /dev/null @@ -1,25 +0,0 @@ -vim.api.nvim_create_autocmd("TermOpen", { - callback = function(args) - vim.keymap.set("n", "q", function() - require("bufdelete").bufdelete(0, true) - end, { silent = true, buffer = args.buf, remap = true, desc = "Close Terminal Buffer" }) - end, -}) - -return { - { - "famiu/bufdelete.nvim", - cmd = "Bdelete", - keys = { - { "", "Bdelete", desc = "Close Buffer", mode = { "", "!", "v" } }, - { - "", - function() - require("bufdelete").bufdelete(0, true) - end, - desc = "Close Buffer", - mode = { "t" }, - }, - }, - }, -} diff --git a/users/price/dots/.config/nvim/lua/plugins/configs/snacks.lua b/users/price/dots/.config/nvim/lua/plugins/configs/snacks.lua index e0cbe61e..ae0d15c1 100644 --- a/users/price/dots/.config/nvim/lua/plugins/configs/snacks.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/snacks.lua @@ -1,9 +1,34 @@ +vim.api.nvim_create_autocmd("TermOpen", { + callback = function(args) + vim.keymap.set("n", "q", function() + require("snacks").bufdelete.delete({ force = true }) + end, { silent = true, buffer = args.buf, remap = true, desc = "Close Terminal Buffer" }) + end, +}) + return { { "folke/snacks.nvim", priority = 1000, lazy = false, keys = { + { + "", + function() + require("snacks").bufdelete.delete() + end, + desc = "Close Buffer", + mode = { "", "!", "v" }, + }, + + { + "", + function() + require("snacks").bufdelete.delete({ force = true }) + end, + desc = "Close Buffer", + mode = { "t" }, + }, { "nd", function() @@ -30,7 +55,7 @@ return { margin = { top = 1 }, }, words = { enabled = true }, - statuscolumn = { enabled = false } + statuscolumn = { enabled = false }, }) _G.bt = snacks.debug.backtrace _G.dd = snacks.debug.inspect