tpope / vim-markdown

Vim Markdown runtime files
1.22k stars 191 forks source link

Custom background color for fenced code blocks #204

Open MaxGyver83 opened 1 year ago

MaxGyver83 commented 1 year ago

I would like to set a custom background color for fenced code blocks with syntax highlighting activated.

When I don't activate syntax highlighting, I can set a background color for code blocks like this:

:highlight markdownCodeBlock ctermbg=240

When I activate syntax highlighting for fenced code blocks (p.e. let g:markdown_fenced_languages = ['py=python', 'python', 'c', 'sh', 'bash=sh']), the background color is ignored (or overruled).

Is it somehow possible to force a background color for all fenced code blocks, no matter if syntax highlighting is activated (like you see it often in rendered Markdown in a web browser)?