/odin.nvim

Primary LanguageLuaMIT LicenseMIT

Plugin Support

Requirements

  • Neovim >= 0.5.0

Installation

Install via your favourite package manager:

" If you are using Vim Plug
Plug 'loydandrew/odin.nvim', { 'branch': 'main' }
-- If you are using Packer
use 'loydandrew/odin.nvim'

Usage

For the defaults, simply enable the colorscheme:

" Vim Script
colorscheme odin
-- Lua
require('odin').setup()

To enable the odin theme for Lualine, specify it in your lualine settings:

require('lualine').setup {
  options = {
    -- ... your lualine config
    theme = 'odin'
    -- ... your lualine config
  }
}

Configuration

The configuration of different options is done through a setup function which will handle setting the colors, so there's no need to set colorscheme yourself! This is an example of the function with the default values:

require('odin').setup({
  theme = nil, -- "dark" or "light". Alternatively, remove the option and set vim.o.background instead
  borders = true, -- Split window borders
  fade_nc = true, -- Fade non-current windows, making them more distinguishable
  styles = {
    comments = "NONE", -- Style that is applied to comments: see `highlight-args` for options
    strings = "NONE", -- Style that is applied to strings: see `highlight-args` for options
    keywords = "NONE", -- Style that is applied to keywords: see `highlight-args` for options
    functions = "NONE", -- Style that is applied to functions: see `highlight-args` for options
    variables = "NONE", -- Style that is applied to variables: see `highlight-args` for options
    diagnostics = "underline", -- Style that is applied to diagnostics: see `highlight-args` for options
  },
  disable = {
    background = false, -- Disable setting the background color
    cursorline = false, -- Disable the cursorline
    eob_lines = true, -- Hide the end-of-buffer lines
  },
  custom_highlights = {}, -- Overwrite default highlight groups
  custom_colors = {}, -- Overwrite default colors
})

Here is an example of overwriting the default highlight groups and colors:

local colors = require("odin.colors")

require("odin").setup({
  custom_highlights = {
    TSConstructor = { fg = colors.dark_blue },
  },
  custom_colors = {
    red = "#ffffff",
  },
})

Basically it's a rewrite from onedark.nvim