mawkler / modicator.nvim

Cursor line number mode indicator plugin for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to customize mode colors after recent changes

rafo opened this issue · comments

commented

Foremost: thanx for this plugin!

I use it mainly to distinguish between normal and insert mode. Quite bold as you can see.
But it seems like this config doesn't work like before any more. This is my config so far:

return {
  "mawkler/modicator.nvim",

  dependencies = "ellisonleao/gruvbox.nvim", -- Add your colorscheme plugin here
  init = function()
    -- These are required for Modicator to work
    vim.o.cursorline = true
    vim.o.number = true
    vim.o.termguicolors = true
  end,
  opts = { -- run require("modicator").setup({foo = "bar"})
    show_warnings = true,
    highlights = {
      defaults = { bold = true },
      modes = {
        ["n"] = { foreground = "#FFFFFF", background = "#00AA55" },
        ["i"] = { foreground = "#FFFFFF", background = "#FF0000" },
      },
    },
  },
}

I don't understand from your description and the :help nvim_set_hl how to change the config to get the bold red bg for the insert mode. So far, this is my nvim_set_hl:

  vim.api.nvim_set_hl(0, "NormalMode", { fg = "#FFFFFF", bg = "#00AA55" }),
  vim.api.nvim_set_hl(0, "InsertMode", { fg = "#FFFFFF", bg = "#FF0000" }),

How can I add this to the modicator config on lazyvim?

@rafo You're almost there! You just need for those last two lines to be executed somewhere in your config. For instance, you could add it to lazy.nvim's config for modicator like so:

return {
  "mawkler/modicator.nvim",

  dependencies = "ellisonleao/gruvbox.nvim", -- Add your colorscheme plugin here
  init = function()
    -- These are required for Modicator to work
    vim.o.cursorline = true
    vim.o.number = true
    vim.o.termguicolors = true
  end,
  config = function()
    vim.api.nvim_set_hl(0, "NormalMode", { fg = "#FFFFFF", bg = "#00AA55" }),
    vim.api.nvim_set_hl(0, "InsertMode", { fg = "#FFFFFF", bg = "#FF0000" }),
  end
  opts = { -- run require("modicator").setup({foo = "bar"})
    show_warnings = true,
    highlights = {
      defaults = { bold = true },
    },
  },
}

Let me know if that works for you!

commented

Just corrected some ,and it works! Thank you!

return {
  "mawkler/modicator.nvim",

  dependencies = "ellisonleao/gruvbox.nvim", -- Add your colorscheme plugin here
  init = function()
    -- These are required for Modicator to work
    vim.o.cursorline = true
    vim.o.number = true
    vim.o.termguicolors = true
  end,
  config = function()
    vim.api.nvim_set_hl(0, "NormalMode", { fg = "#FFFFFF", bg = "#00AA55" })
    vim.api.nvim_set_hl(0, "InsertMode", { fg = "#FFFFFF", bg = "#FF0000" })
  end,
  opts = { -- run require("modicator").setup({foo = "bar"})
    show_warnings = true,
    highlights = {
      defaults = { bold = true },
    },
  },
}

commented

Works now.