nvim-config/lua/configs/bufferline.lua

142 lines
2.8 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 } },
indicator_icon = '',
modified_icon = "",
--buffer_close_icon = "",
show_buffer_close_icons = false,
--close_icon = "",
show_close_icon = false,
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 14,
max_prefix_length = 13,
tab_size = 20,
show_tab_indicators = true,
enforce_regular_tabs = false,
view = "multiwindow",
separator_style = "thick",
always_show_bufferline = true,
diagnostics = false,
},
highlights = {
background = {
guifg = scolors.tab_fg,
guibg = scolors.tab_bg,
},
-- Buffers
buffer_selected = {
guifg = scolors.selected_fg,
guibg = scolors.selected_bg,
--gui = colors.none,
},
buffer_visible = {
guifg = scolors.selected_fg,
guibg = scolors.selected_bg,
},
-- Diagnostics
error = {
guifg = scolors.red,
guibg = scolors.red,
},
error_diagnostic = {
guifg = scolors.red,
guibg = scolors.red,
},
-- Close buttons
close_button = {
guifg = scolors.tab_fg,
guibg = scolors.tab_bg,
},
close_button_visible = {
guifg = scolors.selected_fg,
guibg = scolors.selected_bg,
},
close_button_selected = {
guifg = scolors.red,
guibg = scolors.selected_bg,
},
fill = {
guifg = scolors.empty_fg,
guibg = scolors.empty_bg,
},
indicator_selected = {
guifg = scolors.green,
guibg = scolors.selected_bg,
},
-- Modified
modified = {
guifg = scolors.red,
guibg = scolors.tab_bg,
},
modified_visible = {
guifg = scolors.tab_fg,
guibg = scolors.tab_bg,
},
modified_selected = {
guifg = scolors.green,
guibg = scolors.selected_bg,
},
-- Separators
separator = {
guifg = scolors.empty_bg,
guibg = scolors.tab_bg,
},
separator_visible = {
guifg = scolors.empty_bg,
guibg = scolors.selected_bg,
},
separator_selected = {
guifg = scolors.empty_bg,
guibg = scolors.selected_bg,
},
-- Tabs
tab = {
guifg = scolors.tab_fg,
guibg = scolors.tab_bg,
},
tab_selected = {
guifg = scolors.selected_fg,
guibg = scolors.selected_bg,
},
tab_close = {
guifg = scolors.selected_fg,
guibg = scolors.selected_bg,
},
}
}
end
return M