Add bufdelete
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>q",
|
||||
":Bwipeout<CR>",
|
||||
{ remap = false, silent = true, }
|
||||
)
|
||||
+35
-34
@@ -23,41 +23,42 @@ local ft_map = {
|
||||
fugitive = false,
|
||||
}
|
||||
|
||||
require("bufferline").setup(
|
||||
{
|
||||
options = {
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
custom_filter = function (buf, _)
|
||||
local buf_ft = vim.bo[buf].filetype
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
close_command = "Bwipeout %d",
|
||||
right_mouse_command = nil,
|
||||
middle_mouse_command = "Bwipeout %d",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
custom_filter = function (buf, _)
|
||||
local buf_ft = vim.bo[buf].filetype
|
||||
|
||||
if ft_map[buf_ft] == nil then
|
||||
ft_map[buf_ft] = true -- enable by default
|
||||
end
|
||||
if ft_map[buf_ft] == nil then
|
||||
ft_map[buf_ft] = true -- enable by default
|
||||
end
|
||||
|
||||
return ft_map[buf_ft]
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
{
|
||||
filetype = "fugitive",
|
||||
text = "Fugitive",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
{
|
||||
filetype = "aerial",
|
||||
text = "Aerial",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
return ft_map[buf_ft]
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
{
|
||||
filetype = "fugitive",
|
||||
text = "Fugitive",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
{
|
||||
filetype = "aerial",
|
||||
text = "Aerial",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
sort_by = "id",
|
||||
},
|
||||
}
|
||||
)
|
||||
sort_by = "id",
|
||||
},
|
||||
})
|
||||
|
||||
@@ -48,8 +48,6 @@ vim.keymap.set("n", "<C-s>", ":w<CR>", opts)
|
||||
-- Cycle buffers
|
||||
vim.keymap.set("n", "<C-End>", ":BufferLineCycleNext<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 ---
|
||||
-- yank/put using named register
|
||||
|
||||
@@ -191,6 +191,10 @@ local plugins = {
|
||||
"RubixDev/mason-update-all",
|
||||
config = function () require("config.mason_update_all") end,
|
||||
},
|
||||
{
|
||||
"famiu/bufdelete.nvim",
|
||||
config = function () require("config.bufdelete") end,
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {}
|
||||
|
||||
Reference in New Issue
Block a user