A Lua port of the great tomasr/molokai colorscheme for Neovim, originally based on the Monokai theme for TextMate by Wimer Hazenberg and its darker variant by Hamish Stuart Macpherson.
Supports Treesitter, LSP diagnostics, semantic tokens, and popular plugins out of the box.
- Neovim >= 0.9.0
- A terminal with true color (24-bit) support
{
"jakubkarlicek/molokai-nvim",
lazy = false,
priority = 1000,
config = function()
require("molokai-nvim").setup()
vim.cmd.colorscheme("molokai-nvim")
end,
}use {
"jakubkarlicek/molokai-nvim",
config = function()
require("molokai-nvim").setup()
vim.cmd.colorscheme("molokai-nvim")
end,
}MiniDeps.add("jakubkarlicek/molokai-nvim")
require("molokai-nvim").setup()
vim.cmd.colorscheme("molokai-nvim")Call setup() before loading the colorscheme:
require("molokai-nvim").setup({
-- your options here
})
vim.cmd.colorscheme("molokai-nvim")Or use the defaults with no arguments:
require("molokai-nvim").setup()
vim.cmd.colorscheme("molokai-nvim")These are the default values. All fields are optional.
require("molokai-nvim").setup({
italic = true, -- enable italic styling globally
bg = "dark", -- "dark" (#1B1D1E) or "alt" (#272822, original Monokai bg)
styles = {
comments = {}, -- e.g. { italic = true }
keywords = {}, -- e.g. { bold = true, italic = false }
functions = {},
variables = {},
types = {}, -- e.g. { italic = true }
},
on_colors = function(colors)
-- Override palette colors before highlights are computed
-- colors.bg = "#000000"
end,
on_highlights = function(hl, colors)
-- Override specific highlight groups
-- hl.Normal = { fg = colors.white, bg = "#000000" }
end,
})| Option | Type | Default | Description |
|---|---|---|---|
italic |
boolean | true |
Enable italic styling for comments, keywords, types, etc. |
bg |
string | "dark" |
Background variant: "dark" or "alt" (original Monokai) |
styles |
table | {} |
Per-group style overrides (see below) |
The styles table lets you override the styling for specific syntax groups.
Each entry accepts any valid nvim_set_hl attributes (e.g. italic, bold,
underline). An empty table {} uses the theme defaults.
styles = {
comments = { italic = true },
keywords = { bold = true },
functions = {}, -- uses theme default
variables = {},
types = { italic = true },
}on_colors(colors) is called after the palette is loaded but before
highlights are computed. Use it to tweak individual palette colors:
on_colors = function(colors)
colors.pink = "#FF6188"
colors.bg = "#000000"
endon_highlights(hl, colors) is called after all highlight groups are
built. Use it to override or add specific groups:
on_highlights = function(hl, colors)
hl.CursorLine = { bg = "#1a1a2e" }
hl.TelescopeBorder = { fg = colors.cyan }
endYou can access the theme colors for use in other plugins:
-- Raw palette
local palette = require("molokai-nvim").palette()
-- Resolved colors (respects the bg config option)
local colors = require("molokai-nvim").colors()molokai-nvim includes a lualine theme that is automatically discovered when
you set theme = "auto" in your lualine config:
require("lualine").setup({
options = {
theme = "auto",
},
})You can also set it explicitly:
require("lualine").setup({
options = {
theme = "molokai-nvim",
},
})The following plugins have highlight groups defined out of the box:
- nvim-treesitter (full highlight + semantic token support)
- LSP diagnostics (signs, virtual text, underlines)
- Telescope
- blink.cmp
- gitsigns.nvim
- indent-blankline.nvim
- nvim-dap-ui
- lualine.nvim
- Tomas Restrepo -- original molokai.vim colorscheme
- Wimer Hazenberg -- Monokai theme for TextMate
- Hamish Stuart Macpherson -- darker Monokai variant