sainnhe / sonokai

High Contrast & Vivid Color Scheme based on Monokai Pro
MIT License
1.65k stars 119 forks source link

Changing colour of markdown block quotes #17

Closed djtsorrell closed 3 years ago

djtsorrell commented 3 years ago

I've read the docs and found out how I could change the colour of certain highlight groups. I wish to change the colour of markdown block quotes from grey to white. This is what I have in my init.vim

if has('termguicolors')
    set termguicolors
endif
let g:sonokai_style = 'shusia'
let g:sonokai_enable_italic = 1
let g:sonokai_diagnostic_line_highlight = 1

function! s:sonokai_custom() abort
    highlight! link markdownBlockquote Grey
    let l:palette = sonokai#get_palette('shusia')
    call sonokai#highlight('Grey', l:palette.fg, l:palette.none)
endfunction

augroup SonokaiCustom
  autocmd!
  autocmd ColorScheme sonokai call s:sonokai_custom()
augroup END

colorscheme sonokai

Unfortunately, this hasn't changed the colour of the quotes, but it has changed the colours on Startify (a vim plugin).

sainnhe commented 3 years ago

Grey is a predefined highlight group, which is linked to many other hi groups, so usually you'd better not to change it.

That's said, you should remove these two lines.

    let l:palette = sonokai#get_palette('shusia')
    call sonokai#highlight('Grey', l:palette.fg, l:palette.none)

This line

highlight! link markdownBlockquote Grey

means you linked markdownBlockquote to Grey, but what you want is to make the markdown block quote white, so you should link this group to another predefined hi group Fg.

This should work, but the premise is that markdownBlockquote does decide the color of markdown block quote.

djtsorrell commented 3 years ago

Thanks for this. I did try using Fg but it didn't change anything. I think this may be a clash with vim-polyglot. When I disabled markdown syntax highlighting it changed the block quotes to white!