Skip to content

liamrlawrence/crayons.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

crayons.nvim

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.

Features

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

Requirements

  • Neovim 0.5+
  • cabinet.nvim for configuration management.
  • The themes that you will be using.

Installation

Use your preferred package manager to install crayons:

lazy.nvim

return {
    "liamrlawrence/crayons.nvim",
    dependencies = {
        "liamrlawrence/cabinet.nvim",
        -- Themes go here
    },

    config = function()
        require("crayons").setup()
    end
}

Configuration

The crayons.nvim setup function allows you to customize and extend the plugin according to your needs. Below are the configuration options available:

Adding New Themes

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",
            }
        },
        -- ...
    }
})

Adding Special Themes

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

Customizing Keybindings

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

Usage

Switching Themes

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.

License

crayons.nvim is released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages