Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Headline Color Not Working #73

Open
smsossah opened this issue Mar 6, 2024 · 1 comment
Open

Changing Headline Color Not Working #73

smsossah opened this issue Mar 6, 2024 · 1 comment

Comments

@smsossah
Copy link

smsossah commented Mar 6, 2024

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants