2021-08-22 03:49:15 -04:00
|
|
|
local colors = require("colors").get()
|
2021-07-15 00:48:10 -04:00
|
|
|
|
2021-07-17 07:14:52 -04:00
|
|
|
local present, bufferline = pcall(require, "bufferline")
|
|
|
|
if not present then
|
2021-08-16 03:49:09 -04:00
|
|
|
return
|
2021-07-15 11:43:17 -04:00
|
|
|
end
|
2021-08-19 04:28:07 -04:00
|
|
|
|
2021-08-26 07:41:42 -04:00
|
|
|
-- function executed for top right close button in bufferline
|
|
|
|
vim.cmd "function! NvChad_bufferline_quitvim(a,b,c,d) \n qa \n endfunction"
|
2021-08-26 05:31:48 -04:00
|
|
|
|
2021-07-15 11:43:17 -04:00
|
|
|
bufferline.setup {
|
2021-08-16 03:49:09 -04:00
|
|
|
options = {
|
|
|
|
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
|
|
|
buffer_close_icon = "",
|
|
|
|
modified_icon = "",
|
|
|
|
close_icon = "",
|
2021-08-26 05:31:48 -04:00
|
|
|
show_close_icon = false,
|
2021-08-16 03:49:09 -04:00
|
|
|
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",
|
|
|
|
show_buffer_close_icons = true,
|
|
|
|
separator_style = "thin",
|
|
|
|
always_show_bufferline = true,
|
2021-08-24 11:45:05 -04:00
|
|
|
diagnostics = false, -- "or nvim-lsp"
|
2021-08-26 05:31:48 -04:00
|
|
|
|
|
|
|
custom_areas = {
|
|
|
|
right = function()
|
|
|
|
local result = {}
|
2021-08-26 07:41:42 -04:00
|
|
|
table.insert(
|
|
|
|
result,
|
|
|
|
{ text = "%@NvChad_bufferline_quitvim@ %X", guifg = colors.red, guibg = colors.black }
|
|
|
|
)
|
2021-08-26 05:31:48 -04:00
|
|
|
return result
|
|
|
|
end,
|
|
|
|
},
|
2021-08-18 06:13:35 -04:00
|
|
|
custom_filter = function(buf_number)
|
2021-08-19 04:28:07 -04:00
|
|
|
-- Func to filter out our managed/persistent split terms
|
|
|
|
local present_type, type = pcall(function()
|
|
|
|
return vim.api.nvim_buf_get_var(buf_number, "term_type")
|
|
|
|
end)
|
|
|
|
|
|
|
|
if present_type then
|
|
|
|
if type == "vert" then
|
2021-08-18 06:13:35 -04:00
|
|
|
return false
|
|
|
|
elseif type == "hori" then
|
|
|
|
return false
|
|
|
|
else
|
2021-08-19 04:28:07 -04:00
|
|
|
return true
|
2021-08-18 06:13:35 -04:00
|
|
|
end
|
2021-08-19 04:28:07 -04:00
|
|
|
else
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end,
|
2021-08-16 03:49:09 -04:00
|
|
|
},
|
2021-08-26 05:31:48 -04:00
|
|
|
|
2021-08-16 03:49:09 -04:00
|
|
|
highlights = {
|
|
|
|
background = {
|
|
|
|
guifg = colors.grey_fg,
|
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
|
2021-08-16 03:49:09 -04:00
|
|
|
-- buffers
|
|
|
|
buffer_selected = {
|
|
|
|
guifg = colors.white,
|
|
|
|
guibg = colors.black,
|
|
|
|
gui = "bold",
|
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
buffer_visible = {
|
2021-08-16 03:49:09 -04:00
|
|
|
guifg = colors.light_grey,
|
2021-08-22 03:49:15 -04:00
|
|
|
guibg = colors.black2,
|
2021-08-16 03:49:09 -04:00
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
|
|
|
|
-- close buttons
|
|
|
|
close_button = {
|
|
|
|
guifg = colors.light_grey,
|
|
|
|
guibg = colors.black2,
|
2021-08-16 03:49:09 -04:00
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
close_button_visible = {
|
|
|
|
guifg = colors.light_grey,
|
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
|
|
|
close_button_selected = {
|
2021-08-16 03:49:09 -04:00
|
|
|
guifg = colors.red,
|
|
|
|
guibg = colors.black,
|
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
fill = {
|
|
|
|
guifg = colors.grey_fg,
|
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
2021-08-16 03:49:09 -04:00
|
|
|
indicator_selected = {
|
|
|
|
guifg = colors.black,
|
|
|
|
guibg = colors.black,
|
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
|
2021-08-16 03:49:09 -04:00
|
|
|
-- modified
|
|
|
|
modified = {
|
|
|
|
guifg = colors.red,
|
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
|
|
|
modified_visible = {
|
|
|
|
guifg = colors.red,
|
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
|
|
|
modified_selected = {
|
|
|
|
guifg = colors.green,
|
|
|
|
guibg = colors.black,
|
|
|
|
},
|
2021-07-15 00:48:10 -04:00
|
|
|
|
2021-08-22 03:49:15 -04:00
|
|
|
-- separators
|
|
|
|
separator = {
|
|
|
|
guifg = colors.black2,
|
2021-08-16 03:49:09 -04:00
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
separator_visible = {
|
|
|
|
guifg = colors.black2,
|
2021-08-16 03:49:09 -04:00
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
separator_selected = {
|
|
|
|
guifg = colors.black2,
|
|
|
|
guibg = colors.black2,
|
|
|
|
},
|
|
|
|
-- tabs
|
|
|
|
tab = {
|
|
|
|
guifg = colors.light_grey,
|
|
|
|
guibg = colors.one_bg3,
|
|
|
|
},
|
|
|
|
tab_selected = {
|
|
|
|
guifg = colors.black2,
|
|
|
|
guibg = colors.nord_blue,
|
|
|
|
},
|
|
|
|
tab_close = {
|
2021-08-16 03:49:09 -04:00
|
|
|
guifg = colors.red,
|
|
|
|
guibg = colors.black,
|
|
|
|
},
|
|
|
|
},
|
2021-03-07 09:22:30 -05:00
|
|
|
}
|