Skip to content

An opinionated bright, redshift-friendly and vibrant theme for neovim that includes a colorscheme. It strives to be: simple, light and familiar.

License

Notifications You must be signed in to change notification settings

EtiamNullam/white-chocolate.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

white-chocolate.nvim

It's an opinionated bright theme for neovim containing my custom color scheme and configurations for theme-related plugins.

image

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.

Goals

  • 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.

Features

  • 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, and winbar.

Why not dark theme?

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.

Why it doesn't have a stronger yellow/orange tint?

It's better to remove blue light globally using system-wide tools, than for every app separately.

Installation

Use your favorite plugin manager.

vim-plug:

local plug = vim.fn['plug#']

vim.call('plug#begin')

  plug('EtiamNullam/white-chocolate.nvim')

vim.call('plug#end')

require('white-chocolate').setup()

lazy.nvim:

{
  'EtiamNullam/white-chocolate.nvim',
  config = function()
    require('white-chocolate').setup()
  end,
},

Dependencies

You have to install them if you want extra functionality.

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
      },
    },
  },
},

Configuration

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).

Usage

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' })

Using theme colors

You can access exposed default color scheme like this:

local white_chocolate_colorscheme = require('white-chocolate.colorscheme')

Updating

I will try to follow Semantic Versioning 2.0.

Which means given major.minor.patch:

  • major will change on API-breaking changes
  • minor will change on compatible changes
  • patch will change on bugfixes

Pinning

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

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,
},

About

An opinionated bright, redshift-friendly and vibrant theme for neovim that includes a colorscheme. It strives to be: simple, light and familiar.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages