2022-02-28 03:11:17 +00:00
|
|
|
local M = {}
|
2022-05-01 17:43:11 +00:00
|
|
|
|
2022-02-28 03:11:17 +00:00
|
|
|
function M.config()
|
2023-01-10 18:21:09 +00:00
|
|
|
local status_ok, bufferline = pcall(require, 'bufferline')
|
|
|
|
if not status_ok then
|
2022-02-28 03:11:17 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Semantic Colors
|
|
|
|
local scolors = {
|
2022-09-30 17:30:39 +00:00
|
|
|
white_fg = '#ced2dc',
|
2022-10-04 03:54:10 +00:00
|
|
|
gray_fg = '#a6abb2',
|
2022-09-30 17:30:39 +00:00
|
|
|
|
|
|
|
tab_visible_bg = '#404040',
|
|
|
|
tab_bg = '#353535',
|
2022-03-01 00:41:08 +00:00
|
|
|
empty_bg = '#252526',
|
2022-09-30 17:30:39 +00:00
|
|
|
|
2022-02-28 03:11:17 +00:00
|
|
|
green = '#6a9955',
|
2022-09-30 17:30:39 +00:00
|
|
|
yellow = '#d8b92d',
|
2022-02-28 03:11:17 +00:00
|
|
|
red = '#d16969',
|
|
|
|
none = 'NONE',
|
|
|
|
}
|
|
|
|
|
2023-01-10 18:21:09 +00:00
|
|
|
bufferline.setup({
|
2022-02-28 03:11:17 +00:00
|
|
|
options = {
|
2023-01-10 18:21:09 +00:00
|
|
|
close_command = 'Bdelete! %d', -- use vim-bbye
|
|
|
|
right_mouse_command = 'Bdelete! %d', -- use vim-bbye
|
2022-09-19 20:04:23 +00:00
|
|
|
offsets = {
|
2022-09-30 17:30:39 +00:00
|
|
|
{
|
2023-01-10 18:21:09 +00:00
|
|
|
filetype = 'NvimTree',
|
|
|
|
text = '',
|
|
|
|
padding = 1,
|
|
|
|
},
|
2022-09-30 17:30:39 +00:00
|
|
|
},
|
|
|
|
indicator = {
|
|
|
|
icon = '▎',
|
2023-01-10 18:21:09 +00:00
|
|
|
style = 'icon',
|
2022-09-30 17:30:39 +00:00
|
|
|
},
|
2023-01-10 18:21:09 +00:00
|
|
|
modified_icon = '',
|
2022-02-28 03:11:17 +00:00
|
|
|
--buffer_close_icon = "",
|
|
|
|
show_buffer_close_icons = false,
|
|
|
|
--close_icon = "",
|
|
|
|
show_close_icon = false,
|
2023-01-10 18:21:09 +00:00
|
|
|
left_trunc_marker = '',
|
|
|
|
right_trunc_marker = '',
|
2022-09-20 00:02:20 +00:00
|
|
|
tab_size = 12, -- minimum size
|
2022-09-19 20:04:23 +00:00
|
|
|
max_name_length = 40,
|
2022-02-28 03:11:17 +00:00
|
|
|
max_prefix_length = 13,
|
|
|
|
show_tab_indicators = true,
|
|
|
|
enforce_regular_tabs = false,
|
2023-01-10 18:21:09 +00:00
|
|
|
view = 'multiwindow',
|
|
|
|
separator_style = 'thick',
|
2022-02-28 03:11:17 +00:00
|
|
|
always_show_bufferline = true,
|
|
|
|
diagnostics = false,
|
|
|
|
},
|
|
|
|
|
|
|
|
highlights = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fill = {
|
|
|
|
fg = scolors.white_fg,
|
|
|
|
bg = scolors.empty_bg,
|
|
|
|
},
|
2022-02-28 03:11:17 +00:00
|
|
|
background = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
2022-09-16 05:38:02 +00:00
|
|
|
bg = scolors.tab_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Buffers
|
|
|
|
buffer_selected = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
--gui = colors.none,
|
|
|
|
},
|
|
|
|
buffer_visible = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
|
2023-01-10 18:21:09 +00:00
|
|
|
-- de-duplicate text
|
|
|
|
duplicate = {
|
2022-10-04 03:54:10 +00:00
|
|
|
fg = scolors.gray_fg,
|
|
|
|
bg = scolors.tab_bg,
|
|
|
|
--gui = colors.none,
|
|
|
|
},
|
|
|
|
duplicate_visible = {
|
|
|
|
fg = scolors.gray_fg,
|
|
|
|
bg = scolors.tab_visible_bg,
|
|
|
|
},
|
|
|
|
duplicate_selected = {
|
|
|
|
fg = scolors.gray_fg,
|
|
|
|
bg = scolors.tab_visible_bg,
|
|
|
|
},
|
|
|
|
|
2022-02-28 03:11:17 +00:00
|
|
|
-- Diagnostics
|
|
|
|
error = {
|
2022-09-16 05:38:02 +00:00
|
|
|
fg = scolors.red,
|
|
|
|
bg = scolors.red,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
error_diagnostic = {
|
2022-09-16 05:38:02 +00:00
|
|
|
fg = scolors.red,
|
|
|
|
bg = scolors.red,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Close buttons
|
|
|
|
close_button = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
2022-09-16 05:38:02 +00:00
|
|
|
bg = scolors.tab_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
close_button_visible = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
close_button_selected = {
|
2022-09-16 05:38:02 +00:00
|
|
|
fg = scolors.red,
|
2022-09-30 17:30:39 +00:00
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
2022-09-30 17:30:39 +00:00
|
|
|
|
|
|
|
-- Open buffer indicator
|
2022-02-28 03:11:17 +00:00
|
|
|
indicator_selected = {
|
2022-09-16 05:38:02 +00:00
|
|
|
fg = scolors.green,
|
2022-09-30 17:30:39 +00:00
|
|
|
bg = scolors.tab_visible_bg,
|
|
|
|
},
|
|
|
|
indicator_visible = {
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Modified
|
|
|
|
modified = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.yellow,
|
2022-09-16 05:38:02 +00:00
|
|
|
bg = scolors.tab_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
modified_visible = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.yellow,
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
modified_selected = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.yellow,
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Separators
|
|
|
|
separator = {
|
2022-09-16 05:38:02 +00:00
|
|
|
fg = scolors.empty_bg,
|
|
|
|
bg = scolors.tab_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
separator_visible = {
|
2022-09-16 05:38:02 +00:00
|
|
|
fg = scolors.empty_bg,
|
2022-09-30 17:30:39 +00:00
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
separator_selected = {
|
2022-09-16 05:38:02 +00:00
|
|
|
fg = scolors.empty_bg,
|
2022-09-30 17:30:39 +00:00
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Tabs
|
|
|
|
tab = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
2022-09-16 05:38:02 +00:00
|
|
|
bg = scolors.tab_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
tab_selected = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
|
|
|
tab_close = {
|
2022-09-30 17:30:39 +00:00
|
|
|
fg = scolors.white_fg,
|
|
|
|
bg = scolors.tab_visible_bg,
|
2022-02-28 03:11:17 +00:00
|
|
|
},
|
2023-01-10 18:21:09 +00:00
|
|
|
},
|
|
|
|
})
|
2022-02-28 03:11:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|