Skip to content

khoido2003/monokai-v2.nvim

Repository files navigation

Monokai Pro Color Palette

Important

Clear Cache After Updating or Reinstalling the Theme

This colorscheme uses a compiled highlight cache for fast performance.
Because of that, you must clear the cache any time the theme files change, including:

  • After updating via Lazy, Packer, vim-plug, Pathogen, or any plugin manager
  • After pulling new commits or merging PRs
  • After switching branches or switching filters
  • After modifying theme settings that affect highlight generation
  • After removing and reinstalling the plugin (old cache still exists)

If you do not clear the cache, Neovim may continue using outdated highlights.

Run this command after any update or reinstall inside Neovim:

:MonokaiCache clear

Exit Neovim

The theme will automatically recompile on the next load.

Monokai Pro V2

A fork of loctvl842/monokai-pro.nvim with personal improvements and additional plugin support.

About

This is a personal fork of the excellent monokai-pro.nvim theme for Neovim. While the original theme is already feature-rich and well-maintained, I've made some improvements to better suit my workflow and preferences.

Differences from Original

This fork introduces several improvements and additional support compared to the original:

  • Better Treesitter Support – More precise syntax highlighting across multiple languages, including fallback colors for C# and other languages without active LSP.
  • Respect LSP Semantic Tokens – Ensures colors match LSP token types when available, providing consistent highlighting between Treesitter and LSP.
  • UI Bug Fixes – Fixed issues with floating windows, markdown previews, and other elements that didn’t render correctly with the original theme.
  • Toggle Italics in Treesitter – Users can easily enable or disable italic styles globally via configuration.
  • Expanded Plugin Support – Added styling for popular plugins (Snacks, Heirline, nvim-dap-virtual-text, Barbar, Oil, Avante, Grug-far, etc.)
  • Blazing Fast Performance – Uses a compilation system to statically cache highlights, reducing startup time to ~2ms.

These improvements aim to make the theme more consistent, modern, and configurable for Neovim setup.

Installation

Lazy.nvim (Recommended)

{
  "khoido2003/monokai-v2.nvim",
  priority = 1000,
  config = function()
    require("monokai-v2").setup()
    vim.cmd("colorscheme monokai-v2")
  end,
}

Packer

use {
  "khoido2003/monokai-v2.nvim",
  config = function()
    require("monokai-v2").setup()
    vim.cmd("colorscheme monokai-v2")
  end
}

Optional Dependencies

For the best experience, consider installing these optional plugins:

nvim-web-devicons

For Monokai-themed file icons in file explorers (nvim-tree, neo-tree, telescope, etc.):

-- Add to your plugin manager
{ "nvim-tree/nvim-web-devicons" }

Then enable devicons in the theme config:

require("monokai-v2").setup({
  devicons = true,  -- Enable Monokai colors for file icons
})

This will colorize 200+ file type icons with Monokai colors. Requires a Nerd Font.

Note: Devicons support is enabled by default. If you don't have nvim-web-devicons installed, it will be safely skipped.

Important Plugin Configuration

fzf-lua

For fzf-lua to use the theme's highlight groups (border, cursor, matches) instead of standard ANSI colors, you must enable fzf_colors in your fzf-lua setup:

require('fzf-lua').setup({
  fzf_colors = true
})

Without this setting, fzf-lua may show incorrect colors (like cyan paths or red matches) because it falls back to its default ANSI coloring.

Configuration

require("monokai-v2").setup({
  -- Basic settings
  transparent_background = false,
  terminal_colors = true,
  devicons = true,
  
  -- Syntax highlighting styles
  styles = {
    comment = { italic = false },
    keyword = { italic = false },
    type = { italic = false },
    storageclass = { italic = false },
    structure = { italic = false },
    parameter = { italic = false },
    annotation = { italic = false },
    tag_attribute = { italic = false },
  },
  
  -- Treesitter settings
  treesitter = {
    italic = false,
  },
  
  -- Filter selection (default: classic for dark, light for light background)
  filter = "pro", -- classic | light | machine | octagon | pro | ristretto | spectrum
  
  -- Day/night mode
  day_night = {
    enable = false,
    day_filter = "pro",
    night_filter = "spectrum",
  },
  
  -- Incremental search style
  inc_search = "background", -- underline | background
  
  -- Background clearing for floating windows
  background_clear = {
    "toggleterm",
    "telescope", 
    "renamer",
    "notify",
  },
  
  -- Plugin-specific settings
  plugins = {
    bufferline = {
      underline_selected = false,
      underline_visible = false,
      underline_fill = false,
      bold = true,
    },
    indent_blankline = {
      context_highlight = "default", -- default | pro
      context_start_underline = false,
    },
  },
})

Usage

Commands

  • :MonokaiFilter - Interactive menu to select a filter variant
  • :MonokaiFilter <filter> - Direct filter selection (e.g. :MonokaiFilter pro)
  • :MonokaiCache clear - Clear the compiled highlight cache
  • :MonokaiCache compile - Clear cache and recompile by reloading the colorscheme

Statusline Integration

-- Lualine
require('lualine').setup({
  options = {
    theme = 'monokai-v2'
  }
})

-- Barbecue
require('barbecue').setup({
  theme = 'monokai-v2'
})

-- Lightline
let g:lightline = {'colorscheme': 'monokaiv2'}

Filter Variants

Each filter provides a unique take on the Monokai Pro theme:

  • Classic - The original Monokai theme
  • Light - Light variant for bright environments
  • Pro - The signature Monokai Pro look
  • Machine - Industrial, high-contrast variant
  • Octagon - Geometric, structured appearance
  • Ristretto - Muted, coffee-inspired tones
  • Spectrum - Vibrant, colorful variant

Gallery:

Filter Preview
Classic Classic Filter
Pro Pro Filter
Machine Machine Filter
Octagon Octagon Filter
Ristretto Octagon Filter
Spectrum Spectrum Filter
Light Spectrum Filter

Contributing

If you'd like to help improve this theme:

  • Open an issue if you find any bugs
  • Submit a PR if you have any improvements
  • Share your ideas through discussions

Feel free to:

  • Report issues
  • Suggest improvements
  • Submit pull requests

Credits

This is a personal fork with personal improvements and preferences. For the original, well-maintained theme, please check out the source repository.

About

Monokai Pro V2 Colorscheme for Neovim (v0.2.12)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors