markdown.nvim
markdown.nvim copied to clipboard
help: change wikilinks higlights (and code block icon colors)
Neovim version (nvim -v)
NVIM v0.11.0-dev-959+g4b90952851
Neovim distribution
None
Description
Hi! I'm trying to change wikilink highlights but the following regex fails:
link = {
custom = {
wiki = {
-- FIXME: Not working
pattern = '(%[%[[^%]]+%]%])',
icon = ' ',
highlight = 'RenderMarkdownWiki',
},
},
},
Any pointers?
Also is it possible to avoid having colors in code blocks icons? I.e I would like the icon python bit not to be in yellow in the following image:
Added these as features here: https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/965c222076b2d289ed498730845d533780f3c7c7.
Use link.wiki.icon & link.wiki.highlight to modify WikiLink behavior rather than a custom pattern. The default values are:
require('render-markdown').setup({
link = {
wiki = { icon = ' ', highlight = 'RenderMarkdownWikiLink' },
},
})
For the code language I still need some highlight in order to render these so I added code.highlight_language which lets you override the value from the icon provider. For example:
require('render-markdown').setup({
code = {
highlight_language = 'LineNr',
},
})
Use link.wiki.icon & link.wiki.highlight to modify WikiLink behavior rather than a custom pattern
Brilliant!
so I added code.highlight_language
This is perfect. One minor question/request: is it possible to show the icon without the language name? i.e just the icon
Sure, added here: https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/18c7ef71fb4b8d83cb0160adc9127fc4d65ca42e
Set code.language_name to false:
require('render-markdown').setup({
code = {
language_name = false,
},
})
Thank you! Feel free to close this issue.