Skip to content

Monokai Pro theme for Neovim written in Lua, with multiple filters: Pro, Classic, Machine, Octagon, Ristretto, Spectrum

License

Notifications You must be signed in to change notification settings

ChemicalLuck/monokai-pro.nvim

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

img_v3_0274_94b96554-6c31-431b-a95e-2de719b493hu

Beautiful functionality for professional developers

Find out more here monokai.pro

monokai-pro-macbook

⭐ Pro

pro

πŸ›‘ Octagon

octagon

πŸ€– Machine

machine

β˜• Ristretto

ristretto

🌈 Spectrum

spectrum

πŸ‘΄ Classic

classic

πŸ”Œ Plugin support

πŸ“¦ Installation

vim-plug

Plug 'loctvl842/monokai-pro.nvim'

packer

use {
  "loctvl842/monokai-pro.nvim",
  config = function()
    require("monokai-pro").setup()
  end
}

πŸ”¨ Configuration

There are several themes included in this plugin.

  • Pro – Monokai Pro (default)
  • Octagon – Monokai Pro (Filter Octagon)
  • Machine – Monokai Pro (Filter Machine)
  • Ristretto – Monokai Pro (Filter Machine)
  • Spectrum – Monokai Pro (Filter Machine)
  • Classic – Monokai Classic

Example configuration:

require("monokai-pro").setup({
  transparent_background = false,
  terminal_colors = true,
  devicons = true, -- highlight the icons of `nvim-web-devicons`
  styles = {
    comment = { italic = true },
    keyword = { italic = true }, -- any other keyword
    type = { italic = true }, -- (preferred) int, long, char, etc
    storageclass = { italic = true }, -- static, register, volatile, etc
    structure = { italic = true }, -- struct, union, enum, etc
    parameter = { italic = true }, -- parameter pass in function
    annotation = { italic = true },
    tag_attribute = { italic = true }, -- attribute of tag in reactjs
  },
  filter = "pro", -- classic | octagon | pro | machine | ristretto | spectrum
  -- Enable this will disable filter option
  day_night = {
    enable = false, -- turn off by default
    day_filter = "pro", -- classic | octagon | pro | machine | ristretto | spectrum
    night_filter = "spectrum", -- classic | octagon | pro | machine | ristretto | spectrum
  },
  inc_search = "background", -- underline | background
  background_clear = {
    -- "float_win",
    "toggleterm",
    "telescope",
    -- "which-key",
    "renamer",
    "notify",
    -- "nvim-tree",
    -- "neo-tree",
    -- "bufferline", -- better used if background of `neo-tree` or `nvim-tree` is cleared
  },-- "float_win", "toggleterm", "telescope", "which-key", "renamer", "neo-tree", "nvim-tree", "bufferline"
  plugins = {
    bufferline = {
      underline_selected = false,
      underline_visible = false,
    },
    indent_blankline = {
      context_highlight = "default", -- default | pro
      context_start_underline = false,
    },
  },
  ---@param c Colorscheme
  override = function(c) end,
})
  • Check my nvim to see my plugins setup for border if you want to set background_clear

For example:

float_win
require("monokai-pro").setup({
    -- ... your config
    background_clear = { "float_win" }
    -- ... your config
})

require("cmp").setup({
    -- ... your config
    window = {
      border = "rounded",
    }
    completion = {
        border = "rounded",
    }
    -- ... your config
})
  • With the above config: bg_clear_cmp

  • With the default config: default_cmp

Telescope
require("monokai-pro").setup({
    -- ... your config
    background_clear = {}
    -- ... your config
})

require("telescope").setup({
    -- ... your config
    defaults = {
      borderchars = { "β–ˆ", " ", "β–€", "β–ˆ", "β–ˆ", " ", " ", "β–€" },
    }
    -- ... your config
})
  • With the above config:

removed_border_telescope

  • With the default config: default_telescope

πŸ“š Usage

  • Enable this colorscheme by using the following command after setup:
" Vim Script
colorscheme monokai-pro
require("monokai-pro").setup({
  -- ... your config
})
-- lua
vim.cmd([[colorscheme monokai-pro]])
  • To enable monokai-pro for Lualine:
require('lualine').setup {
  options = {
    -- ...
    theme = 'monokai-pro'
    -- ...
  }
}
  • To enable monokai-pro for barbecue:
require('barbecue').setup {
  -- ...
  theme = 'monokai-pro'
  -- ...
}
  • To enable monokai-pro for lightline:
" Vim Script
let g:lightline = {'colorscheme': 'monokaipro'}
  • Override function:
require("monokai-pro").setup({
    -- ...
    override = function
      return {
          Normal = { bg = "#000000" }
        }
    end
    -- ...
  })
  • Custom your own palette:

This is a sample config to customize Tokyonight palette:

require("monokai-pro").setup({
    -- ...
    --- @param filter "classic" | "machine" | "octagon" | "pro" | "ristretto" | "spectrum"
    override = function(c)
      return {
        IndentBlanklineChar = { fg = c.base.dimmed4 },
      }
    end,
    overridePalette = function(filter)
      return {
        dark2 = "#101014",
        dark1 = "#16161E",
        background = "#1A1B26",
        text = "#C0CAF5",
        accent1 = "#f7768e",
        accent2 = "#7aa2f7",
        accent3 = "#e0af68",
        accent4 = "#9ece6a",
        accent5 = "#0DB9D7",
        accent6 = "#9d7cd8",
        dimmed1 = "#737aa2",
        dimmed2 = "#787c99",
        dimmed3 = "#363b54",
        dimmed4 = "#363b54",
        dimmed5 = "#16161e",
      }
    end
    -- ...
  })

πŸ”§ Command

  • run command MonokaiProSelect to launch a menu to choose theme filter (required: nui.nvim)
  • or we can run command MonokaiPro with parameter to change theme filter: For example:

    MonokaiPro classic

About

Monokai Pro theme for Neovim written in Lua, with multiple filters: Pro, Classic, Machine, Octagon, Ristretto, Spectrum

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 99.9%
  • Vim Script 0.1%