Skip to content

Change highlight color after initialization #134

@xeruf

Description

@xeruf

I would like to set the whitespace highlight color depending on the background, which seems to be automatically detected by neovim at some point, but stays at 'dark' while my vimrc is being loaded.

So I tried this:

let g:better_whitespace_guicolor='Brown'
autocmd OptionSet background let g:better_whitespace_guicolor=&background == 'light' ? 'LightYellow' : 'Brown'

Then, after background is set to 'light', :echo g:better_whitespace_guicolor returns 'LightYellow', yet the whitespace is highlighted in Brown.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions