cpea2506/one_monokai.nvim

github github
colorschemetreesitter-colorschemes
stars 182
issues 1
subscribers 1
forks 11
CREATED

2021-10-29

UPDATED

11 days ago


A VSCode One Monokai-inspired colorscheme, rewritten in Lua for seamless Neovim integration.

demo

transparent demo

:rocket: Installation

{
  "cpea2506/one_monokai.nvim",
}

Requirements

  • Neovim >= 0.9.1
  • nvim-treesitter for enhanced syntax highlighting (optional) 😇

:gear: Setup

vim.cmd.colorscheme "one_monokai"

Or use the following approach if you wish to customize options:

require("one_monokai").setup({
    -- your custom options here
})

Available Options

Option Description Type Note
transparent Enables a transparent background boolean N/A
colors Custom color definitions table<string, string|number> N/A
highlights Custom highlight groups function(colors): table :h nvim_set_hl
italics Enables italic boolean N/A

Default Configuration

require("one_monokai").setup({
    transparent = false,
    colors = {},
    highlights = function(colors)
        return {}
    end,
    italics = true,
})

Customization Examples

Available Colors and Highlights

  1. Colors
  2. Highlights

The color module provides two methods, darken and lighten, to blend colors based on an alpha value (between 0 and 1). You can use them as follows:

colors["<color-name>"]:darken(alpha)
colors["<color-name>"]:lighten(alpha)

Example Configuration

require("one_monokai").setup({
    transparent = true,  -- Enable transparent background
    colors = {
        pink = "#ec6075", -- Override a default color
        lmao = "#ffffff", -- Define a new color as hexadecimal string
        human = 0xFFABCD, -- Define a new color as number
        alien = 16755661, -- Why not?
    },
    highlights = function(colors)
        -- Customize highlight groups
        -- The key-value pairs are passed to "nvim_set_hl"
        return {
            Normal = { bg = colors.lmao },
            DiffChange = { fg = colors.white:darken(0.3) },
            ErrorMsg = { fg = colors.pink, standout = true },
            ["@lsp.type.keyword"] = { link = "@keyword" }
        }
    end,
    italics = false, -- Disable italic
})

[!TIP] To find the highlight group for an item, place the cursor under it and run :Inspect. Refer to :h :Inspect for more information.

:champagne: Plugin Support

lualine demo

require("lualine").setup {
  options = {
      -- ...other options
      theme = "one_monokai"
  }
}

:eyes: Inspiration

This is, in my opinion, the best theme I’ve ever used. After using it in Vim for a long time, I rewrote it in Lua to ensure better compatibility with Neovim and to allow for easier customization.

A huge thanks to these talented and inspiring creators:

:scroll: Contribution

For detailed instructions on how to contribute to this colorscheme, please see the contributing guidelines.