It's an opinionated bright theme for neovim
containing my custom color scheme and configurations for theme-related plugins.
Every bright color scheme that I've tried had some issues, so I've decided to make my own. At first it based on RRethy/nvim-base16
.
Simple
- both in use and development.Familiar
- provides colors that you are used to.Light
- minimal performance impact.
Make sure to raise an issue if you have any suggestion about how we can get closer to these goals.
- Almost completely white background.
- Plays nicely with reduced blue light (and green to some extend).
- Provides distinct and intense colors.
- Displays yank register preview at a glance.
- Includes optional configurations for
statusline
,bufferline
,tabline
, andwinbar
.
- It makes reading harder. Especially if you have astigmatism - About 40% of population have astigmatism.
- It consumes more power as you need to increase brightness.
- It provides far less blue light. Exposure to blue light (during the day, in moderation) increases alertness, is beneficial for memory and helps with depression.
- It's less blinding in the dark, but it's still a bad idea to stare at your screen in the dark. Instead turn on the lights in your room and reduce the brightness in software (system settings and programs) or hardware (monitor settings).
- Sudden appearance of bright scene on dark theme can be dramatic. It's only mildly disappointing when it happens in the other way. Bright background is still the default in most places.
Arguments in favor for dark theme:
- On OLED display every pixel can turn off separately when its completely black, this looks neat and reduces power consumption.
It's better to remove blue light globally using system-wide tools, than for every app separately.
Use your favorite plugin manager.
local plug = vim.fn['plug#']
vim.call('plug#begin')
plug('EtiamNullam/white-chocolate.nvim')
vim.call('plug#end')
require('white-chocolate').setup()
{
'EtiamNullam/white-chocolate.nvim',
config = function()
require('white-chocolate').setup()
end,
},
You have to install them if you want extra functionality.
windwp/windline.nvim
-statusline
, optional, recommendednoib3/nvim-cokeline
-bufferline + tabline
, optional, recommendednvim-lua/plenary.nvim
- required dependency ofnvim-cokeline
nvim-tree/nvim-web-devicons
- icons inbufferline
, optional dependency ofnvim-cokeline
, recommendedstevearc/resession.nvim
- optional dependency ofnvim-cokeline
vim-plug
snippet:
local plug = vim.fn['plug#']
vim.call('plug#begin')
plug('EtiamNullam/white-chocolate.nvim')
plug('windwp/windline.nvim') -- optional, recommended
plug('noib3/nvim-cokeline') -- optional, recommended
plug('nvim-lua/plenary.nvim') -- required for cokeline
plug('nvim-tree/nvim-web-devicons') -- optional, recommended
plug('stevearc/resession.nvim') -- optional
vim.call('plug#end')
require('white-chocolate').setup()
lazy.nvim
snippet:
{
'EtiamNullam/white-chocolate.nvim',
config = function()
require('white-chocolate').setup()
end,
dependencies = {
{ 'windwp/windline.nvim' }, -- optional, recommended
{
'noib3/nvim-cokeline', -- optional, recommended
dependencies = {
{ 'nvim-lua/plenary.nvim' }, -- required for cokeline
{ 'nvim-tree/nvim-web-devicons' }, -- optional, recommended
{ 'stevearc/resession.nvim' }, -- optional
},
},
},
},
Default options:
require('white-chocolate').setup()
Custom options (defaults in example):
require('white-chocolate').setup {
invert_visual = true, -- visual mode will flip background of selected text
setup_bufferline = false, -- configures bufferline and tabline using optional dependency 'noib3/nvim-cokeline'
setup_statusline = false, -- configures statusline and winbar using 'windwp/windline.nvim'
fix_terminal_background = false, -- remove padding in terminal around neovim instance
use_previous_options = false, -- apply options on top of previous options
apply_immediately = true, -- apply theme immediately
trigger_events = true, -- invoke colorscheme related events
color_overrides = {
background = '#fffdfb',
foreground = '#643d2c',
cursor = '#0022aa',
cursorline = '#eee9e7',
floating_window = '#e4d7d3',
comment = '#9d8580',
parameter = '#b1a600',
info = '#1aa7d6',
error = '#da1306',
current = '#69b98b',
change = '#be621e',
string = '#81ba01',
special = '#a54dff',
action = '#476cff',
key = '#bf1ca2',
},
}
I recommend to enable setup_statusline
and setup_bufferline
(requires optional dependecies).
As long as you run setup()
with your preferred configuration plugin will work mostly out of the box.
If you decide to use noib3/nvim-cokeline
for bufferline and tabline you might want to define mappings for switching buffers, my preference:
Note
You might want to change your <Leader>
key first, I suggest vim.g.mapleader = ' '
.
vim.keymap.set('n', '<Leader>bj', function()
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(
'<Plug>(cokeline-focus-next)<Leader>b',
true,
false,
true
),
'm',
true
)
end, { desc = 'Buffer: Go to next' })
vim.keymap.set('n', '<Leader>bk', function()
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(
'<Plug>(cokeline-focus-prev)<Leader>b',
true,
false,
true
),
'm',
true
)
end, { desc = 'Buffer: Go to previous' })
You can access exposed default color scheme like this:
local white_chocolate_colorscheme = require('white-chocolate.colorscheme')
I will try to follow Semantic Versioning 2.0
.
Which means given major
.minor
.patch
:
major
will change on API-breaking changesminor
will change on compatible changespatch
will change on bugfixes
Branches v<major>
, v<major>.<minor>
and tags v<major>.<minor>.<patch>
are available to follow so you don't have to worry about plugin breaking on update.
It's recommended to at least pin to the recent major version, especially if you do some configuration.
Examples using lazy.nvim
:
New features without breaking changes:
{
'EtiamNullam/white-chocolate.nvim',
branch = 'v1',
config = function()
require('white-chocolate').setup()
end,
},
Bugfixes only:
{
'EtiamNullam/white-chocolate.nvim',
branch = 'v1.2',
config = function()
require('white-chocolate').setup()
end,
},
Pin to a specific version:
{
'EtiamNullam/white-chocolate.nvim',
tag = 'v1.2.1',
config = function()
require('white-chocolate').setup()
end,
},