Add bufdelete

This commit is contained in:
2023-09-04 20:22:59 +02:00
parent 6892081736
commit f74d4c73f2
4 changed files with 45 additions and 36 deletions
+6
View File
@@ -0,0 +1,6 @@
vim.keymap.set(
"n",
"<leader>q",
":Bwipeout<CR>",
{ remap = false, silent = true, }
)
+5 -4
View File
@@ -23,9 +23,11 @@ local ft_map = {
fugitive = false, fugitive = false,
} }
require("bufferline").setup( require("bufferline").setup({
{
options = { options = {
close_command = "Bwipeout %d",
right_mouse_command = nil,
middle_mouse_command = "Bwipeout %d",
diagnostics = "nvim_lsp", diagnostics = "nvim_lsp",
diagnostics_update_in_insert = false, diagnostics_update_in_insert = false,
custom_filter = function (buf, _) custom_filter = function (buf, _)
@@ -59,5 +61,4 @@ require("bufferline").setup(
}, },
sort_by = "id", sort_by = "id",
}, },
} })
)
-2
View File
@@ -48,8 +48,6 @@ vim.keymap.set("n", "<C-s>", ":w<CR>", opts)
-- Cycle buffers -- Cycle buffers
vim.keymap.set("n", "<C-End>", ":BufferLineCycleNext<CR>", opts) vim.keymap.set("n", "<C-End>", ":BufferLineCycleNext<CR>", opts)
vim.keymap.set("n", "<C-Home>", ":BufferLineCyclePrev<CR>", opts) vim.keymap.set("n", "<C-Home>", ":BufferLineCyclePrev<CR>", opts)
-- Close buffer without closing window
vim.keymap.set("n", "<leader>q", ":bp<bar>sp<bar>bn<bar>bd<CR>", opts)
--- General mappings --- --- General mappings ---
-- yank/put using named register -- yank/put using named register
+4
View File
@@ -191,6 +191,10 @@ local plugins = {
"RubixDev/mason-update-all", "RubixDev/mason-update-all",
config = function () require("config.mason_update_all") end, config = function () require("config.mason_update_all") end,
}, },
{
"famiu/bufdelete.nvim",
config = function () require("config.bufdelete") end,
},
} }
local opts = {} local opts = {}