neovim-confs/lua/plex/plugins/extras/ui/bufferline.lua

55 lines
1.4 KiB
Lua
Raw Normal View History

2023-09-06 00:26:45 +02:00
return {
{
'akinsho/bufferline.nvim',
event = 'VeryLazy',
opts = {
options = {
2023-09-22 13:47:57 +02:00
-- :h bufferline-configuration
2023-09-06 00:26:45 +02:00
mode = 'tabs',
2023-09-22 13:47:57 +02:00
separator_style = {"", ""},
themable = true,
numbers = "ordinal",
2023-09-06 00:26:45 +02:00
show_close_icon = false,
show_buffer_close_icons = false,
2023-09-22 13:47:57 +02:00
diagnostics = true,
indicator = {
-- icon = ' ', -- this should be omitted if indicator style is not 'icon'
-- windows terminal sucks
style = 'none',
},
2023-09-06 00:26:45 +02:00
always_show_bufferline = true,
diagnostics_indicator = function(_, _, diag)
2023-09-06 10:19:56 +02:00
local icons = require('plex.config').icons.diagnostics
2023-09-06 00:26:45 +02:00
local ret = (diag.error and icons.Error .. diag.error .. ' ' or '')
.. (diag.warning and icons.Warn .. diag.warning or '')
return vim.trim(ret)
end,
custom_areas = {
right = function()
2023-09-06 10:19:56 +02:00
local project_root = require('plex.lib.badge').project()
2023-09-06 00:26:45 +02:00
local result = {}
local part = {}
part.text = '%#BufferLineTab# ' .. project_root
table.insert(result, part)
-- Session indicator
if vim.v['this_session'] ~= '' then
table.insert(result, { text = '%#BufferLineTab#  ' })
end
return result
end,
},
offsets = {
{
filetype = 'neo-tree',
text = 'Neo-tree',
highlight = 'Directory',
text_align = 'center',
},
},
2023-09-22 13:47:57 +02:00
2023-09-06 00:26:45 +02:00
},
},
},
}