mirror of
https://github.com/DefectingCat/dotfiles
synced 2025-07-15 16:51:36 +00:00
37 lines
987 B
Lua
37 lines
987 B
Lua
local status, bufferline = pcall(require, "bufferline")
|
|
if not status then
|
|
return
|
|
end
|
|
|
|
bufferline.setup({
|
|
options = {
|
|
-- 关闭 Tab 的命令
|
|
close_command = "Bdelete! %d",
|
|
right_mouse_command = "Bdelete! %d",
|
|
-- 侧边栏配置
|
|
-- 左侧让出 nvim-tree 的位置,显示文字 File Explorer
|
|
offsets = {
|
|
{
|
|
filetype = "NvimTree",
|
|
text = "File Explorer",
|
|
highlight = "Directory",
|
|
text_align = "left",
|
|
},
|
|
},
|
|
diagnostics = "nvim_lsp",
|
|
-- 可选,显示 LSP 报错图标
|
|
---@diagnostic disable-next-line: unused-local
|
|
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
|
-- local s = " "
|
|
-- for e, n in pairs(diagnostics_dict) do
|
|
-- local sym = e == "error" and " " or (e == "warning" and " " or "")
|
|
-- s = s .. n .. sym
|
|
-- end
|
|
-- return s
|
|
-- end,
|
|
},
|
|
})
|
|
|
|
vim.keymap.set("n", "<Tab>", "<Cmd>BufferLineCycleNext<CR>", {})
|
|
vim.keymap.set("n", "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>", {})
|