Member-only story

Neovim for Beginners — Color Scheme

Let’s learn to create Treesitter-supported color schemes.

--

Neovim for Beginners — Color Scheme

We use the Everforest theme which is a green-based color scheme. It is designed to be warm and soft to protect developers’ eyes. To better customize Neovim to fit our needs, let’s learn how to create Neovim color schemes.

In this article, we are going to

  • Learn the basics of the Neovim color scheme. We will configure a colorizer plugin, check out the built-in color schemes, understand Treesitter highlight groups and the base16 architecture for building themes.
  • Configure color schemes with and without using base16.

This article is part of the Neovim for Beginners series.

The Neovim configuration files can be found in this repository.

Getting Started

Colorizer Plugins

Let’s get started by installing a plugin to help us better see the colors in Neovim. There are several plugins that we can use.

Either one of these plugins can be used. In this article, we are going to use the colorizer.lua plugin.

We can install this plugin using packer.nvim.

use {
"norcalli/nvim-colorizer.lua",
cmd = "ColorizerToggle",
config = function()
require("colorizer").setup()
end,
}

Once the plugin is installed, we can easily see the colors for all color codes in a buffer by using the ColorizerToggle command.

Colorizer

The Basics

To see the code for all the built-in color schemes, type :e $VIMRUNTIME/colors.

Built-in Color Schemes

To learn the basics of writing a color scheme file, we can refer to the runtime colors/README.txt

--

--

alpha2phi
alpha2phi

Written by alpha2phi

Software engineer, Data Science and ML practitioner.

No responses yet