2021-07-17 12:14:52 +01:00
|
|
|
local present, bufferline = pcall(require, "bufferline")
|
2022-05-05 18:19:51 +01:00
|
|
|
|
2021-07-17 12:14:52 +01:00
|
|
|
if not present then
|
2021-08-16 08:49:09 +01:00
|
|
|
return
|
2021-07-15 16:43:17 +01:00
|
|
|
end
|
2021-08-19 09:28:07 +01:00
|
|
|
|
2022-06-14 13:06:27 +01:00
|
|
|
require("base46").load_highlight "bufferline"
|
|
|
|
|
2022-05-06 15:44:57 +01:00
|
|
|
vim.cmd [[
|
2022-06-18 05:27:17 +01:00
|
|
|
|
2022-05-06 15:44:57 +01:00
|
|
|
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 16:42:28 +01:00
|
|
|
local options = {
|
2021-08-16 08:49:09 +01:00
|
|
|
options = {
|
|
|
|
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
|
|
|
buffer_close_icon = "",
|
|
|
|
modified_icon = "",
|
2021-08-30 07:10:58 +01:00
|
|
|
close_icon = "",
|
2022-05-06 15:44:57 +01:00
|
|
|
show_close_icon = false,
|
2022-05-29 05:46:31 +01:00
|
|
|
left_trunc_marker = " ",
|
|
|
|
right_trunc_marker = " ",
|
2022-06-18 05:27:17 +01:00
|
|
|
max_name_length = 20,
|
2021-08-16 08:49:09 +01:00
|
|
|
max_prefix_length = 13,
|
|
|
|
tab_size = 20,
|
|
|
|
show_tab_indicators = true,
|
|
|
|
enforce_regular_tabs = false,
|
|
|
|
show_buffer_close_icons = true,
|
|
|
|
separator_style = "thin",
|
2022-05-05 18:19:51 +01:00
|
|
|
themable = true,
|
2022-05-06 15:44:57 +01:00
|
|
|
|
2022-06-18 05:27:17 +01:00
|
|
|
-- top right buttons in bufferline
|
2022-05-06 15:44:57 +01:00
|
|
|
custom_areas = {
|
|
|
|
right = function()
|
|
|
|
return {
|
|
|
|
{ text = "%@Toggle_theme@" .. vim.g.toggle_theme_icon .. "%X" },
|
2022-05-12 13:56:01 +01:00
|
|
|
{ text = "%@Quit_vim@ %X" },
|
2022-05-06 15:44:57 +01:00
|
|
|
}
|
|
|
|
end,
|
|
|
|
},
|
2021-08-16 08:49:09 +01:00
|
|
|
},
|
2021-03-07 14:22:30 +00:00
|
|
|
}
|
2022-01-21 00:26:05 +00:00
|
|
|
|
2022-04-27 16:42:28 +01:00
|
|
|
-- check for any override
|
2022-05-29 11:37:47 +01:00
|
|
|
options = require("core.utils").load_override(options, "akinsho/bufferline.nvim")
|
2022-01-21 00:26:05 +00:00
|
|
|
|
2022-04-27 16:42:28 +01:00
|
|
|
bufferline.setup(options)
|