feat(dropbar): add default config (needed to fix)

This commit is contained in:
doryan 2024-12-13 15:28:02 +04:00
parent dfd0917f9a
commit ec99f601a0

View File

@ -1,30 +1,10 @@
local sources = require("dropbar.sources")
local function get_hl_color(group, attr)
return vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID(group)), attr)
end
vim.cmd [[hi WinBar guisp=#665c54 guibg=#313131]]
vim.cmd [[hi WinBarNC guisp=#665c54 guibg=#313131]]
require("dropbar").setup(
{
bar = {
sources = {
{
get_symbols = function(buf, win, cursor)
local symbols = sources.path.get_symbols(buf, win, cursor)
for _, symbol in ipairs(symbols) do
local icon_fg = get_hl_color(symbol.icon_hl, "fg#")
local icon_string = ""
vim.cmd(icon_string)
vim.api.nvim_create_autocmd({ 'BufReadPost', 'BufNewFile', 'BufWritePost' }, {
once = true,
group = vim.api.nvim_create_augroup('DropBarSetup', {}),
callback = function()
if vim.g.loaded_dropbar then
return
end
return symbols
end
}
}
}
}
)
require('dropbar').setup()
end,
})