SidOfc / mkdx

A vim plugin that adds some nice extra's for working with markdown documents
https://www.vim.org/scripts/script.php?script_id=5620
MIT License
482 stars 13 forks source link

[Feature request] Simple one color highlight for ``` code blocks #155

Closed mareksamec closed 3 years ago

mareksamec commented 3 years ago

Would it be possible to add simple one color highlight for code blocks (regardless of the code language)? In default vim markdown highlight it is hard to distinguish normal text from code blocks. Added screens below.

This is plain vim with mkdx: image

This is similar section displayed with gabrielelana/vim-markdown plugin. Unfortunately this plugin is a bit slow with nvim and has some overlaps with mkxd (where mkdx does far better job): image

SidOfc commented 3 years ago

Hello @mareksamec!

I see the issue here with distinguishing fenced code blocks, but I think their styling depends on the colorscheme you are using, for me they look like this already:

image

That said, the syntax group for the content of the fenced block (excluding delimiters) is markdownCode, you can style this yourself quite easily with:

highlight markdownCode ctermfg=12 guifg=Red

Which looks like this for me (guifg is shown here):

image

Since mkdx already has some 40+ settings to allow circumventing some plugin conflicts and just for general customization, and because this is pretty much a one liner already, I don't think it really adds anything to implement within mkdx itself.

For this reason, I will close this issue, if you have any remaining questions about this, feel free to comment.

EDIT: and last but not least, thanks for the feedback :+1:

SidOfc commented 3 years ago

I also forgot to mention that some users use additional plugins/settings to get syntax-specific highlighting for their code blocks, mkdx only does this for YAML/JSON frontmatter as to not become too sluggish while detecting / syncing the syntax groups (mixing lots of syntaxes in one file really slows down (n)vim).