NLKNguyen / papercolor-theme

:art: Light & Dark Vim color schemes inspired by Google's Material Design
MIT License
2.71k stars 239 forks source link

Is there a way to disable spellcheck fg/bg color changing (not underline) purely from nvim.init? #141

Open djsavvy opened 4 years ago

djsavvy commented 4 years ago

I am trying to disable changing the background/foreground color of text due to spellchecking (but keep the red squiggly underlines); I realized I can do this by commenting out the following lines in PaperColor.vim:

  " Plugin: Spell Checking
  exec 'hi SpellBad' . s:fg_foreground . s:bg_spellbad
  exec 'hi SpellCap' . s:fg_foreground . s:bg_spellcap
  exec 'hi SpellRare' . s:fg_foreground . s:bg_spellrare
  exec 'hi SpellLocal' . s:fg_foreground . s:bg_spelllocal

However, this requires editing the plugin file itself, which might get overwritten by an update. Is there a way to disable the color changing for a specific plugin (i.e. spell checking) purely from my nvim.init file, without having to edit PaperColor.vim?

I spent a while trying to figure this one out but haven't come up with anything.

TerryChau commented 4 years ago

I am having similar issues, and two ideas come to mind. However, neither of them worked as planned. The suggestions below are attempts to set the background color to white.

Idea 1 is to run hi spellbad guibg=#ffffff using autocmd. The other is to change 'override' in g:PaperColor_Theme_Options to include 'spellbad': ['#FFFFFF','15'].

However, both these changes affect the foreground color as well. (Edit: It seems that these methods can disable the background color, but the text is black, instead of the syntax color. I would rather have the text stay the syntax color.) If someone has a good suggestion for disabling background colors for spelling errors, it would be greatly appreciated.

mmrwoods commented 1 year ago

This works for me...

" Disable bg and fg color highlighting of bad spelling in PaperColor
autocmd VimEnter,ColorScheme *
    \ if get(g:, 'colors_name', v:null) ==# 'PaperColor' |
    \   hi Spellbad guibg=NONE guifg=NONE |
    \ endif