loctvl842 / monokai-pro.nvim

Monokai Pro theme for Neovim written in Lua, with multiple filters: Pro, Classic, Machine, Octagon, Ristretto, Spectrum
MIT License
424 stars 40 forks source link

Colors conflict with indentline.nvim #89

Closed diwasrimal closed 6 months ago

diwasrimal commented 9 months ago

The indentline.nvim plugin provides indent guides, but somehow this colorscheme seems to conflict with its indent hightlighting (or the other way around, I am not sure). When I open neovim the indent guides don't appear, when when I run :colo monokai-pro, they appear. I don't know why that is.

I have brought a minimal reproducible example. Below is my ~/.config/nvim

.
├── init.lua
├── lazy-lock.json
└── lua
    ├── core
    │   └── options.lua
    └── plugins
        ├── indentline.lua
        ├── monokai-pro.lua
        └── treesitter.lua

4 directories, 6 files

init.lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    print("Installing lazy.nvim ...")
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable", -- latest stable release
        lazypath,
    })
end
vim.opt.rtp:prepend(lazypath)

-- Core configs loaded from ./lua/core/
require("core.options")

-- Plugins configured at ./lua/plugins/
require("lazy").setup("plugins")

-- Colorscheme
vim.cmd([[colorscheme monokai-pro]])

This is lua/plugins/indentline.lua

return { 
    "lukas-reineke/indent-blankline.nvim", 
    main = "ibl",
    opts = {
        indent = { char = "▏", },
        scope = {
            enabled = false,
            show_start = false,     -- don't underline line where scope begins
            show_end = false,
        }
    },
}

lua/plugins/monokai-pro.lua

return {
    "loctvl842/monokai-pro.nvim",
    opts = {
        filter = "ristretto",
        styles = {
            comment = { italic = false },
            keyword = { italic = false }, -- 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
        },
        plugins = {
            indent_blankline = {
                context_highlight = "default", -- default | pro
            },
        },
    },
}

I am also adding lua/plugins/treesitter.lua just because indentline uses it

return {
    'nvim-treesitter/nvim-treesitter',
    dependencies = {
        'nvim-treesitter/nvim-treesitter-context',
        'nvim-treesitter/nvim-treesitter-textobjects',
    },
    config = function()
        require("nvim-treesitter.configs").setup({
            ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "javascript", "html", "typescript", "python" },
            auto_install = true,
            sync_install = false,
            ignore_install = { "markdown", "diff" },
            highlight = { enable = true, },
            textobjects = {
                select = {
                    enable = true,
                    lookahead = true,
                    ignore_surrounding_whitespace = true,
                    keymaps = {
                        -- You can use the capture groups defined in textobjects.scm
                        ['aa'] = '@parameter.outer',
                        ['ia'] = '@parameter.inner',
                        ["af"] = "@function.outer",
                        ["if"] = "@function.inner",
                        ["ac"] = "@class.outer",
                        ["ic"] = "@class.inner",
                        ["as"] = "@scope",
                    }
                },

                -- Popup window with definition
                -- lsp_interop = {
                --     enable = true,
                --     border = 'none',
                --     floating_preview_opts = {},
                --     peek_definition_code = {
                --         ["<leader>ds"] = "@function.outer",     -- definition show
                --         ["<leader>dS"] = "@class.outer",
                --     },
                -- },
            }
        })
    end,
}

the last one lua/core/options.lua, this should not be making the issue as far as I know.

vim.o.number = true
vim.o.relativenumber = true
vim.o.pumheight = 12
vim.o.shiftwidth = 4
vim.o.tabstop = 4
vim.o.smartindent = true
vim.o.expandtab = true
vim.o.undofile = true
vim.o.hlsearch = true
vim.o.cursorline = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.splitright = true
vim.o.splitbelow = true
vim.o.swapfile = false
vim.o.laststatus = 3
vim.o.updatetime = 250
vim.o.termguicolors = true
vim.o.signcolumn = 'yes'
vim.o.wrap = false
vim.o.scrolloff = 8
vim.g.netrw_banner = 0
CharlieCheckpt commented 8 months ago

Hello, I have the same problem, have you found a way to solve this issue ?

Treeniks commented 8 months ago

Setting indent-blankline's highlight group to Comment or similar fixed it for me:

require("ibl").setup {
    indent = { highlight = 'Comment' },
}
CharlieCheckpt commented 8 months ago

Setting indent-blankline's highlight group to Comment or similar fixed it for me:

require("ibl").setup {
    indent = { highlight = 'Comment' },
}

It also works for me, thank you !