nvim/lua/pika/plugins/bufferline.lua

48 lines
1.7 KiB
Lua

return {
"akinsho/bufferline.nvim",
dependencies = { "echasnovski/mini.icons" },
version = "*",
opts = {
options = {
underline_indicator = true,
diagnostics = "nvim_lsp",
diagnostics_update_on_event = true, -- use nvim's diagnostic handler
diagnostics_indicator = function(count, level)
local icon = level:match("error") and "" or ""
return " " .. icon .. count
end,
offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } },
indicator = {
icon = "", -- this should be omitted if indicator style is not 'icon'
style = "icon",
},
move_wraps_at_ends = true, -- whether or not the move command "wraps" at the first or last position
separator_style = "slope",
modified_icon = "󱞇",
left_trunc_marker = "󰬩",
right_trunc_marker = "󰬫",
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
close_icon = "󱄊",
buffer_close_icon = "󱄊",
show_buffer_icons = true, -- disable filetype icons for buffers
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = true,
hover = {
enabled = true,
delay = 80,
reveal = { "close" },
hide = { "nvim_lsp" },
},
-- You can set buffer_mode to "list" or "tabbed" based on your preference.
buffer_mode = "list",
color_icons = true, -- whether or not to add the filetype icon highlights
},
},
config = function(_, opts)
require("bufferline").setup(opts)
-- Remap the tab key for buffer navigation (you can adjust the keys as needed)
vim.keymap.set("n", "<Tab>", "<cmd>BufferLineCycleNext<CR>")
vim.keymap.set("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<CR>")
end,
}