feat(config): add set_vim_background option #382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
set_vim_backgroundoption (defaulttrue) to control whether or notvim.opt.background = '...'is included in compiler output.There are no breaking changes here; just the ability to opt out of the plugin setting
vim.o.background.Why?
Neovim 0.11.0 introduced the ability to auto-detect the system's color theme, updating
vim.o.backgroundaccordingly. However, this only works if the user has not setvim.o.backgroundin their configuration already.Example
Config (using folke/lazy.nvim)
Default (Pre-existing) Behavior
options.set_vim_background = true(equivalent to the behavior before this PR).set_vim_background_true.mov
Notice that the
OptionSetautocommand doesn't run. This is because thecolorscheme github_default_darkwill setvim.o.background = 'dark'.Feature
options.set_vim_background = falseset_vim_background_false.mov
Notice that now, the
OptionSetautocommand does run, and thevim.o.backgroundgets updated by Neovim.