2021-07-17 07:14:52 -04:00
|
|
|
local present, bufferline = pcall(require, "bufferline")
|
2022-05-05 13:19:51 -04:00
|
|
|
|
2021-07-17 07:14:52 -04:00
|
|
|
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
|
|
|
|
2022-05-06 10:44:57 -04:00
|
|
|
vim.cmd [[
|
|
|
|
function! Toggle_theme(a,b,c,d)
|
|
|
|
lua require('base46').toggle_theme()
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! Quit_vim(a,b,c,d)
|
|
|
|
qa
|
|
|
|
endfunction
|
|
|
|
]]
|
|
|
|
|
2022-04-27 11:42:28 -04:00
|
|
|
local options = {
|
2021-08-16 03:49:09 -04:00
|
|
|
options = {
|
|
|
|
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
|
|
|
buffer_close_icon = "",
|
|
|
|
modified_icon = "",
|
2021-08-30 02:10:58 -04:00
|
|
|
close_icon = "",
|
2022-05-06 10:44:57 -04:00
|
|
|
show_close_icon = false,
|
2022-05-29 00:46:31 -04:00
|
|
|
left_trunc_marker = " ",
|
|
|
|
right_trunc_marker = " ",
|
2021-08-16 03:49:09 -04:00
|
|
|
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-11-17 00:30:57 -05:00
|
|
|
diagnostics = false,
|
2022-05-05 13:19:51 -04:00
|
|
|
themable = true,
|
2022-05-06 10:44:57 -04:00
|
|
|
|
|
|
|
custom_areas = {
|
|
|
|
right = function()
|
|
|
|
return {
|
|
|
|
{ text = "%@Toggle_theme@" .. vim.g.toggle_theme_icon .. "%X" },
|
2022-05-12 08:56:01 -04:00
|
|
|
{ text = "%@Quit_vim@ %X" },
|
2022-05-06 10:44:57 -04:00
|
|
|
}
|
|
|
|
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
|
|
|
|
end
|
2021-08-19 04:28:07 -04:00
|
|
|
return true
|
|
|
|
end
|
2021-11-17 00:30:57 -05:00
|
|
|
|
|
|
|
return true
|
2021-08-19 04:28:07 -04:00
|
|
|
end,
|
2021-08-16 03:49:09 -04:00
|
|
|
},
|
2021-03-07 09:22:30 -05:00
|
|
|
}
|
2022-01-20 19:26:05 -05:00
|
|
|
|
2022-04-27 11:42:28 -04:00
|
|
|
-- check for any override
|
2022-05-10 09:43:48 -04:00
|
|
|
options = nvchad.load_override(options, "akinsho/bufferline.nvim")
|
2022-01-20 19:26:05 -05:00
|
|
|
|
2022-04-27 11:42:28 -04:00
|
|
|
bufferline.setup(options)
|