diff --git a/lua/config/plugins/dropbar.lua b/lua/config/plugins/dropbar.lua index 0b31b07..758c4a2 100644 --- a/lua/config/plugins/dropbar.lua +++ b/lua/config/plugins/dropbar.lua @@ -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) - end - return symbols - end - } - } - } - } -) +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 + require('dropbar').setup() + end, +})