-
Notifications
You must be signed in to change notification settings - Fork 45
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
feature: Highlight groups #70
Comments
…port colorschemes ## Details Request: #70 The current approach of using standard highlight groups works well, however if color scheme maintainers wish to support this plugin specifically it will impact everywhere else the highlight groups are used. To improve this add a level of indirection. Create custom highlights that link to all the same defaults as currently used. That way changing the underlying links still has the same impact as well as being backwards compatible. Users setting custom values also remain unaffected. However color scheme maintainers can override the highlights used by this plugin giving them the ability to apply their theme better to this plugin specifically. I do not think this will be a very common trend, but I am more than happy to support it. Add a table to the README with all the highlghts and default links.
Proposal makes sense to me, the idea of setting a I implemented it here: 0f32655, and used the Added a table with all of the highlights and their defaults to the README as well: https://github.com/MeanderingProgrammer/markdown.nvim?tab=readme-ov-file#colors LMK if I missed anything, really curious how you go about integrating this. Thanks for the interest and the proposal! |
Ignore #2 in my previous comment! I've got it working now :) |
## Details Requested: #70
Ah, understandable, updated here: 6aa19e9. Am curious what updates you needed to make to resolve issues 2 & 3? Since if you had a |
Legend! Thanks so much @MeanderingProgrammer! |
thanks to the latest updates in MeanderingProgrammer/render-markdown.nvim#70 we now have offical support for markdown.nvim!
Looks great! |
@scottmckendry how did you solve the issue with horizontal line color? I just opened an issue #77, but now I'm wondering if there's something wrong with my config perhaps? |
Is your feature request related to a problem? Please describe.
There is currently no easy way for colorsheme maintainers to add support for this plugin. While the defaults are sensible, there are a few things one might like to change to give the best out-of-the-box experience without users having to make too many changes in the config.
Describe the solution you'd like
Each component currently has one or more "highlight` properties that use either tree-sitter groups or a default Neovim highlight group.
What I propose is to define new highlight groups in the plugin that link to the existing highlights. This can be executed somewhere in the plugin's
setup()
logic.For example, for headings, you might add something to the effect of:
default = true
is important here as it preserves the current setting if the highlight group is already defined somewhere else (like in a colorscheme 😉)The naming convention I've used in the example is just a suggestion. Feel free to use whatever you see fit - the namespace is global so unique-ness is important.
Using links keeps the current highlight groups the same for existing users, so no breaking changes should be expected. But it allows colorschemes to adopt their own styling should they choose to add support in the future.
Describe alternatives you've considered
N/A
Additional information
For a good example of how to define many highlight groups at once, I recommend looking at Folke's implementation in trouble.nvim:
https://github.com/folke/trouble.nvim/blob/main/lua/trouble/config/highlights.lua
The text was updated successfully, but these errors were encountered: