Default Heading highlight group configuration #291
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Yeah, I can explain what's going on here. This plugin adopts a common pattern for making plugins have some default color setup while allowing color scheme authors to set plugin specific values. This is done through "default link" highlight groups. So as a base if your color scheme does not specify a value for "RenderMarkdownH1Bg" the color for "DiffAdd" will be used as a fallback, which every color scheme should define (though not all do). This also lets you as a user modify the color used by either modifying the call to setup where "RenderMarkdownH1Bg" is set and changing it to any other highlight group, or you can directly set a value for "RenderMarkdownH1Bg" using the vim api: vim.api.nvim_set_hl(0, 'RenderMarkdownH1Bg', { bg = '#ff0000' })
require('render-markdown').setup({}) In this version you don't need to do anything to the configuration, just set the colors you'd like to use, the above example will set a red background. The point of all of this though is like I said, color schemes can set values for this plugin to make it fit in nicer with their aesthetic. Each plugin integration is a one off so not every color scheme will support this plugin, but many of the popular ones do. The one used in the examples is Your color scheme should list the plugins it supports somewhere in its README, and you're always welcome to create a PR to add support if they don't, though up to their contributing guidelines. I wrote a comprehensive document about how colors work in Neovim that you might find helpful as well: https://github.com/MeanderingProgrammer/render-markdown.nvim/wiki/Colors. |
Beta Was this translation helpful? Give feedback.
Yeah, I can explain what's going on here.
This plugin adopts a common pattern for making plugins have some default color setup while allowing color scheme authors to set plugin specific values. This is done through "default link" highlight groups.
So as a base if your color scheme does not specify a value for "RenderMarkdownH1Bg" the color for "DiffAdd" will be used as a fallback, which every color scheme should define (though not all do).
This also lets you as a user modify the color used by either modifying the call to setup where "RenderMarkdownH1Bg" is set and changing it to any other highlight group, or you can directly set a value for "RenderMarkdownH1Bg" using the vim api: