Skip to content

How to set background color of code block? #73

Answered by jmbuhr
hopezh asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can change the highlighting to whatever highlight group you want. First, open :Telescope highlights to preview available highlight groups:

Next, create a treesitter query file to extend available highlights and assign the highlight group you chose to fenced code blocks in markdown, or, as in the following screenshot, create an entirely new highlight group:

When going the custom route, assign for example a background color to this highlight group:

Here you go:

Caveat: Highlights only extend to where there is actual content. It is currently not straightforward to change the highlighting of the whole area/line as seen in your VSC screenshot.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jmbuhr
Comment options

@hopezh
Comment options

@jmbuhr
Comment options

@hopezh
Comment options

Answer selected by jmbuhr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants