/nvim-grey

A light theme for NeoVim, with a light grey background

Primary LanguageLuaMozilla Public License 2.0MPL-2.0

Grey

A low-contrast theme for NeoVim, based on vim-paper and written in Lua (using nvim_set_hl()). Paper was the first light theme I used/created after years of using dark themes. The rationale for that was as follows:

I created Paper as a replacement for Happy Hacking, and the Autumn theme it was originally based on. I've been using dark themes for the last decade or so, and mostly without issues. But dark themes are not necessarily a good choice for your eyes, and research has shown that it's generally better to have dark text on a light background (see this StackExchange question for some interesting data). In addition, halation becomes a problem when presenting light text on (very) dark backgrounds.

Besides the issues with dark themes, I also simply wanted a theme with fewer colors; making the colors that are used stand out more. I couldn't squeeze this into the Happy Hacking theme without fundamentally changing it, so I created a new theme instead.

Grey is a continuation of the goal of making a light theme that's easy on the eyes, and not distracting by introducing many colors. The most notable difference compared to Paper is that the main background color is a light grey, instead of a light yellow color. Hence the (incredibly creative) name.

Like Paper, this theme is best used on a low brightness display, with a color temperature of <5500K. During the day I use a color temperature of 5200K, while at night the temperature is set to 3800K. This theme probably won't look so good when using the common display temperature of 6500K.

Screenshots

Rust:

Rust

NeoVim's terminal emulator:

Terminal

Telescope (using the provided extension):

Telescope

Requirements

  • NeoVim 0.7.0 or newer (due to the use of nvim_set_hl())
  • true-color support

For best results use set laststatus=3 (introduced in NeoVim 0.8), as the theme is designed with this setting in mind.

Installation

Vim Plug

Plug 'yorickpeterse/nvim-grey'

Telescope extension

An extension for Telescope is included, providing a layout strategy called "grey". It's recommended that Telescope users use this layout, as the theme applies highlights with this layout in mind. To enable, configure Telescope like so:

require('telescope').setup({
  defaults = {
    -- These three settings are optional, but recommended.
    prompt_prefix = '',
    entry_prefix = ' ',
    selection_caret = ' ',

    -- This is the important part: without this, Telescope windows will look a
    -- bit odd due to how borders are highlighted.
    layout_strategy = 'grey',
    layout_config = {
     -- The extension supports both "top" and "bottom" for the prompt.
      prompt_position = 'top',

      -- You can adjust these settings to your liking.
      width = 0.6,
      height = 0.5,
      preview_width = 0.6,
    },
  }
})

telescope.load_extension('grey')

License

All source code in this repository is licensed under the Mozilla Public License version 2.0, unless stated otherwise. A copy of this license can be found in the file "LICENSE".