• Stars
    star
    287
  • Rank 141,162 (Top 3 %)
  • Language
    Lua
  • License
    MIT License
  • Created over 1 year ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cursor line number mode indicator plugin for Neovim

Modicator.nvim 💡

Cursor line number mode indicator.

A small Neovim plugin that changes the foreground color of the CursorLineNr highlight based on the current Vim mode.

modicator

Setup

require('modicator').setup()

Note that modicator requires you to have termguicolors, cursorline, number set. In Lua this is done by adding

vim.o.termguicolors = true
vim.o.cursorline = true
vim.o.number = true

somewhere in your Neovim configuration.

Modicator sets the Normal mode highlight foreground based on the default foreground color of CursorLineNr so if you're using a colorscheme make sure that it gets loaded before this plugin.

With lazy.nvim:

return {
  'mawkler/modicator.nvim',
  dependencies = 'mawkler/onedark.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()
    require('modicator').setup()
  end,
}

Or with packer.nvim:

use {
  'mawkler/modicator.nvim',
  after = 'onedark.nvim', -- Add your colorscheme plugin here
  setup = function()
    -- These are required for Modicator to work
    vim.o.cursorline = true
    vim.o.number = true
    vim.o.termguicolors = true
  end,
  config = function()
    require('modicator').setup()
  end
}

Configuration

Modicator uses the the following highlight groups for each mode, respectively:

NormalMode
InsertMode
VisualMode
CommandMode
ReplaceMode
SelectMode
"TerminalMode",
"TerminalNormalMode",

For more information on how to create a highlight group, see :help nvim_set_hl.

Default configuration:

require('modicator').setup({
  -- Show warning if any required option is missing
  show_warnings = true,
  highlights = {
    -- Default options for bold/italic
    defaults = {
      bold = false,
      italic = false
    },
  },
})