Skip to content

tanvirtin/monokai.nvim

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

fix: Remove unexpected space before color in Soda palette
6fb4f7f

Git stats

Files

Permalink
Failed to load latest commit information.

Neovim Monokai

Monokai Theme for Neovim with tree-sitter support

monokai nvim

Supported Monokai Flavours

  • Monokai (monokai)
  • Monokai Pro (monokai_pro)
  • Monokai Soda (monokai_soda)
  • Monokai Ristretto (monokai_ristretto)

Prerequisites

Neovim >= 0.5.

Installation

Plugin Manager Command
Packer use 'tanvirtin/monokai.nvim'
Vim-plug Plug 'tanvirtin/monokai.nvim'
NeoBundle NeoBundle 'tanvirtin/monokai.nvim'
Vundle Bundle 'tanvirtin/monokai.nvim'
Pathogen git clone https://github.com/tanvirtin/monokai.nvim.git ~/.vim/bundle/monokai.nvim
Dein call dein#add('tanvirtin/monokai.nvim')

Usage

In VimL:

syntax on
colorscheme monokai
colorscheme monokai_pro
colorscheme monokai_soda
colorscheme monokai_ristretto

In Lua:

require('monokai').setup {}
require('monokai').setup { palette = require('monokai').pro }
require('monokai').setup { palette = require('monokai').soda }
require('monokai').setup { palette = require('monokai').ristretto }

Customization

It is possible to customize Monokai theme with setup function (only in Lua). Passed argument will override default configuration values witch are:

{
    palette = {
        name = 'monokai',
        base1 = '#272a30',
        base2 = '#26292C',
        base3 = '#2E323C',
        base4 = '#333842',
        base5 = '#4d5154',
        base6 = '#9ca0a4',
        base7 = '#b1b1b1',
        border = '#a1b5b1',
        brown = '#504945',
        white = '#f8f8f0',
        grey = '#8F908A',
        black = '#000000',
        pink = '#f92672',
        green = '#a6e22e',
        aqua = '#66d9ef',
        yellow = '#e6db74',
        orange = '#fd971f',
        purple = '#ae81ff',
        red = '#e95678',
        diff_add = '#3d5213',
        diff_remove = '#4a0f23',
        diff_change = '#27406b',
        diff_text = '#23324d',
    },
    custom_hlgroups = {},
}

An example of this would be as follows:

local monokai = require('monokai')
local palette = monokai.classic
monokai.setup {
    palette = {
        diff_text = '#133337',
    },
    custom_hlgroups = {
        TSInclude = {
            fg = palette.aqua,
        },
        GitSignsAdd = {
            fg = palette.green,
            bg = palette.base2
        },
        GitSignsDelete = {
            fg = palette.pink,
            bg = palette.base2
        },
        GitSignsChange = {
            fg = palette.orange,
            bg = palette.base2
        },
    }
}

With italics option (true by default), you can disable italic used by default in style for some groups (Function, Keyword, Comment...).

require('monokai').setup { italics = false }

Extras

Extra color configs for Kitty, Alacritty, Windows Terminal, can be found in extras. To use them, refer to their respective documentation.