rebelot / heirline.nvim

Heirline.nvim is a no-nonsense Neovim Statusline plugin designed around recursive inheritance to be exceptionally fast and versatile.
MIT License
968 stars 38 forks source link

How to target the background highlight of Winbar's surrounded symbols? #149

Closed TLSingh1 closed 1 year ago

TLSingh1 commented 1 year ago

Hey fam, thank you so much for making my favorite plugin ever!

Sorry if it wasn't clear, but as the title suggests how might I accomplish changing the background highlight of the surround symbols inside of the winbar?

I've attached an image that shows more clearly what I'd like to change.

winbar

This is my winbar:

local WinBar = {
    {
    {
      condition = function ()
        return not conditions.is_active()
      end,
      utils.surround({ " ", " " }, "#000000", { hl = { fg = "#1AF0F1", force = true }, FileName }),
    },
    {
      condition = function ()
        return conditions.is_active()
      end,
      utils.surround({ "", "" }, "#00363C", { hl = { fg = "#1AF0F1", force = true }, FileName }),
    }
    },
}

And here are my nvim's highlights. Perhaps my issue lies here? (sorry I'm a mega noob)

vim.api.nvim_create_autocmd('ColorScheme', {
  callback = vim.schedule_wrap(function ()
    vim.cmd("highlight ActiveWindow guibg=#011826")
    vim.cmd("highlight InactiveWindow guibg=#000000")

    vim.cmd('hi WinBar guibg=#011826 guifg=#ff44e0')
    vim.cmd('hi WinBarNC guibg=#000000 guifg=#ff44e0')

    vim.cmd("highlight NeoTreeTabActive guifg=#1affff guibg=#011826")
    vim.cmd("hi NeoTreeWinSeparator guifg=#011826 guibg=#011826")
    vim.cmd("hi NeoTreeGitStaged guifg=#1aff94")

    vim.cmd('highlight BufferTabpageFill guibg=#000000')
    vim.cmd('highlight BufferCurrent guifg=#1AFFFF guibg=#00363C')
    vim.cmd('highlight BufferVisible  guibg=#011826')
    vim.cmd('highlight BufferInactive guibg=#011826')
    vim.cmd('highlight BufferCurrentSign guibg=#000000')
    vim.cmd('highlight BufferVisibleSign guibg=#000000')
    vim.cmd('highlight BufferInactiveSign guibg=#000000')
  end),
  -- group = vim.api.nvim_create_augroup('foo', {})
})

Any guidance would be super appreciated! Thanks again

TLSingh1 commented 1 year ago

11 minutes later... lol sorry for the trouble.

For the future,

local WinBar = {
    {
        {
            condition = function()
                return not conditions.is_active()
            end,
            utils.surround({ " ", " " }, "#000000", { hl = { fg = "#1AF0F1", force = true }, FileName }),
        },
        {
            condition = function()
                return conditions.is_active()
            end,
            utils.surround({ "", "" }, "#00363C", { hl = { fg = "#1AF0F1", force = true }, FileName }),
            hl = { bg = "#011826" },
        },
    },
}