Skip to content

How do I set a custom background color for *Treesitter* *markdown_inline*? #617

Closed Answered by stevenxxiu
stevenxxiu asked this question in Q&A
Discussion options

You must be logged in to vote

I found Customizing highlighting of individual Neovim windows | by Caleb Taylor | Medium, which was fantastic and worked for me.

The following sets the background color to the same as that in Sublime Text's MarkdownEditing's MarkdownEditor color scheme:

vim.cmd('highlight MarkdownBackground guibg=#ECECEC')

vim.api.nvim_create_autocmd({ 'BufEnter' }, {
  pattern = '*',
  callback = function()
    if vim.api.nvim_buf_get_option(0, 'filetype') == 'markdown' then
      vim.opt_local.winhighlight = 'Normal:MarkdownBackground'
    end
  end,
})

If there's an answer specific to Catppuccin, please post it. I'm more than happy to accept that instead.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stevenxxiu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant