crayons.nvim dynamically manages and applies color schemes and theme settings. It provides a straightforward way to switch between various themes and configurations directly within Neovim.
- Theme Management: Easily switch between multiple themes with predefined variants.
- Custom Keybindings: Assign custom keybindings for different themes and variants.
- Transparency Support: Option to enable or disable transparency for themes.
- Extensible: Add more themes and configurations as needed.
- Persistent: Settings are saved between sessions.
- Neovim 0.5+
- cabinet.nvim for configuration management.
- The themes that you will be using.
Use your preferred package manager to install crayons:
return {
"liamrlawrence/crayons.nvim",
dependencies = {
"liamrlawrence/cabinet.nvim",
-- Themes go here
},
config = function()
require("crayons").setup()
end
}
The crayons.nvim
setup function allows you to customize and extend the plugin according to your needs. Below are the configuration options available:
You can add new themes or modify existing ones by including them in the themes
table during setup. Each theme has several variants (standard, light, dark, darkest). Here’s how you can add a new theme:
require("crayons").setup({
themes = {
{ -- Theme #1
name = "gruvbox",
variants = {
standard = "gruvbox-medium",
light = "gruvbox-light",
dark = "gruvbox-dark",
darkest = "gruvbox-dark",
}
},
{ -- Theme #2
name = "tokyonight",
variants = {
standard = "tokyonight-storm",
light = "tokyonight-day",
dark = "tokyonight-night",
darkest = "tokyonight-night",
}
},
-- ...
}
})
Special themes are ones that have a single variant and you want to assign unique settings, such as transparency and a specific keybindings. You can configure special themes in the special_themes
section of the setup:
require("crayons").setup({
special_themes = {
{
name = "vscode", -- Theme name
mode = "dark", -- "dark" or "light"
transparency = true, -- true or false
keybinding = "<leader>ttv", -- custom binding
},
-- ...
}
})
Keybindings allow you to quickly switch between different theme variants. You can customize these keybindings in the keybindings
field of the setup. Here's how to set up custom keybindings for switching themes:
require("crayons").setup({
keybindings = {
standard = "<leader>tt",
light = "<leader>tl",
dark = "<leader>td",
darkest = "<leader>tD"
}
})
You can use crayons.nvim to switch between themes and their variants through pre-configured keybindings:
- Standard Theme:
<leader>tt#
- Switch to the standard variant of a theme, where#
is the index number of the theme. - Light Theme:
<leader>tl#
- Switch to the light variant of a theme. - Dark Theme:
<leader>td#
- Switch to the dark variant of a theme. - Darkest Theme with Transparency:
<leader>tD#
- Switch to the darkest variant of a theme with transparency enabled.
crayons.nvim is released under the MIT License.