Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
djsavvy opened this issue Feb 17, 2020 · 2 comments

Comments

@djsavvy
Copy link

djsavvy commented Feb 17, 2020

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
Copy link

TerryChau commented May 2, 2020

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
Copy link

mmrwoods commented Dec 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants