lukas-reineke / headlines.nvim

This plugin adds horizontal highlights for text filetypes, like markdown, orgmode, and neorg.
MIT License
688 stars 28 forks source link

Changing Headline Color Not Working #73

Open smsossah opened 6 months ago

smsossah commented 6 months ago

Hello, I've been trying to update the headline colors for neorg without success. See image below:

image

I set the highlight values in my init.lua file:

vim.cmd [[highlight Headline1 guibg=#1e2718]]
vim.cmd [[highlight Headline2 guibg=#21262d]]
vim.cmd [[highlight CodeBlock guibg=#1c1c1c]]
vim.cmd [[highlight Dash guibg=#D19A66 gui=bold]]

And then specify the headline highlights (I'm using packer):

{ "lukas-reineke/headlines.nvim",                                                                   -- adds highlights for Neorg and markdown
      ft = { "markdown", "org", "norg" },
      after = 'nvim-treesitter',
      config = function()
          require('headlines').setup(
          {
              norg = {
                  headline_highlights = { "Headline1", "Headline2" },
                  bullets = {},
                  fat_headline_lower_string = "▀",
              },
          }
          )
      end,
}

But it renders weirdly as shared in the image above. When I comment out headline_highlights, it renders as expected:

image

I thought it might've been a font issue, so I switched to Fira Code temporarily. However, I came across the same issue and I would rather not have to switch Nerd Fonts anyway (I'm using MesloGS NF) since my other plugins require it.

Just wondering if there are any ideas as to what I may be missing here? Any help would be appreciated!

lukas-reineke commented 5 months ago

Looks like the highlight groups are not set yet when you run the headlines.nvim setup function. Try to create the highlight groups right before you call setup, in the config function