nvim-config/lua/configs/bufferline.lua

151 lines
2.9 KiB
Lua
Raw Normal View History

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()
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then
return
end
-- Semantic Colors
local scolors = {
2022-03-01 06:25:44 +00:00
empty_fg = '#ced2dc',
empty_bg = '#252526',
2022-03-01 06:25:44 +00:00
tab_fg = '#ced2dc',
tab_bg = '#303030',
2022-03-01 06:25:44 +00:00
selected_fg = '#ced2dc',
2022-03-01 02:58:43 +00:00
selected_bg = '#404040',
2022-02-28 03:11:17 +00:00
green = '#6a9955',
red = '#d16969',
none = 'NONE',
}
bufferline.setup {
options = {
close_command = "Bdelete! %d", -- use vim-bbye
right_mouse_command = "Bdelete! %d", -- use vim-bbye
offsets = {
{
filetype = "NvimTree",
text = "",
padding = 1
}
},
2022-09-16 05:38:02 +00:00
indicator = {
icon = '',
style = 'icon'
},
2022-02-28 03:11:17 +00:00
modified_icon = "",
--buffer_close_icon = "",
show_buffer_close_icons = false,
--close_icon = "",
show_close_icon = false,
left_trunc_marker = "",
right_trunc_marker = "",
2022-09-20 00:02:20 +00:00
tab_size = 12, -- minimum size
max_name_length = 40,
2022-02-28 03:11:17 +00:00
max_prefix_length = 13,
show_tab_indicators = true,
enforce_regular_tabs = false,
view = "multiwindow",
separator_style = "thick",
always_show_bufferline = true,
diagnostics = false,
},
highlights = {
background = {
2022-09-16 05:38:02 +00:00
fg = scolors.tab_fg,
bg = scolors.tab_bg,
2022-02-28 03:11:17 +00:00
},
-- Buffers
buffer_selected = {
2022-09-16 05:38:02 +00:00
fg = scolors.selected_fg,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
--gui = colors.none,
},
buffer_visible = {
2022-09-16 05:38:02 +00:00
fg = scolors.selected_fg,
bg = scolors.selected_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-16 05:38:02 +00:00
fg = scolors.tab_fg,
bg = scolors.tab_bg,
2022-02-28 03:11:17 +00:00
},
close_button_visible = {
2022-09-16 05:38:02 +00:00
fg = scolors.selected_fg,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
},
close_button_selected = {
2022-09-16 05:38:02 +00:00
fg = scolors.red,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
},
fill = {
2022-09-16 05:38:02 +00:00
fg = scolors.empty_fg,
bg = scolors.empty_bg,
2022-02-28 03:11:17 +00:00
},
indicator_selected = {
2022-09-16 05:38:02 +00:00
fg = scolors.green,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
},
-- Modified
modified = {
2022-09-16 05:38:02 +00:00
fg = scolors.red,
bg = scolors.tab_bg,
2022-02-28 03:11:17 +00:00
},
modified_visible = {
2022-09-16 05:38:02 +00:00
fg = scolors.tab_fg,
bg = scolors.tab_bg,
2022-02-28 03:11:17 +00:00
},
modified_selected = {
2022-09-16 05:38:02 +00:00
fg = scolors.green,
bg = scolors.selected_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,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
},
separator_selected = {
2022-09-16 05:38:02 +00:00
fg = scolors.empty_bg,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
},
-- Tabs
tab = {
2022-09-16 05:38:02 +00:00
fg = scolors.tab_fg,
bg = scolors.tab_bg,
2022-02-28 03:11:17 +00:00
},
tab_selected = {
2022-09-16 05:38:02 +00:00
fg = scolors.selected_fg,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
},
tab_close = {
2022-09-16 05:38:02 +00:00
fg = scolors.selected_fg,
bg = scolors.selected_bg,
2022-02-28 03:11:17 +00:00
},
}
}
end
return M