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, }
)
+35 -34
View File
@@ -23,41 +23,42 @@ local ft_map = {
fugitive = false, fugitive = false,
} }
require("bufferline").setup( require("bufferline").setup({
{ options = {
options = { close_command = "Bwipeout %d",
diagnostics = "nvim_lsp", right_mouse_command = nil,
diagnostics_update_in_insert = false, middle_mouse_command = "Bwipeout %d",
custom_filter = function (buf, _) diagnostics = "nvim_lsp",
local buf_ft = vim.bo[buf].filetype diagnostics_update_in_insert = false,
custom_filter = function (buf, _)
local buf_ft = vim.bo[buf].filetype
if ft_map[buf_ft] == nil then if ft_map[buf_ft] == nil then
ft_map[buf_ft] = true -- enable by default ft_map[buf_ft] = true -- enable by default
end end
return ft_map[buf_ft] return ft_map[buf_ft]
end, end,
offsets = { offsets = {
{ {
filetype = "NvimTree", filetype = "NvimTree",
text = "File Explorer", text = "File Explorer",
text_align = "center", text_align = "center",
seperator = true, seperator = true,
}, },
{ {
filetype = "fugitive", filetype = "fugitive",
text = "Fugitive", text = "Fugitive",
text_align = "center", text_align = "center",
seperator = true, seperator = true,
}, },
{ {
filetype = "aerial", filetype = "aerial",
text = "Aerial", text = "Aerial",
text_align = "center", text_align = "center",
seperator = true, seperator = true,
},
}, },
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 = {}