HASSIIYY / anderson.nvim

Anderson colorscheme for Neovim written in Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anderson Scheme

A port of anderson.vim color scheme for Neovim written in Lua.

Palette:

Screenshots:

Features

Installation

Note

This plugin requires Neovim >= 0.5.0

Install via your favourite package manager:

vim-plug

Plug 'HASSIIYY/anderson.nvim'

packer

use 'HASSIIYY/anderson.nvim'

lazy

{ 'HASSIIYY/anderson.nvim' },

Usage and Configuration

Load the color scheme and define the desired options:

-- values shown are defaults and will be used if not provided
require('anderson').setup({
  italics = true,             -- enable italics in general
  comments = {
    italics = true,           -- enable italic comments
  },
  background = {
    transparent = false,      -- set the background to transparent
  },
  float = {
    force_background = false, -- force background on floats even when background.transparent is set
    background_color = nil,   -- set color for float backgrounds. If nil, uses the default color set
                              -- by the color scheme
  },
  signs = {
    highlight = true,         -- whether to highlight signs
  },
  customize = nil,            -- customize the theme in any way you desire, see below what this
                              -- configuration accepts
})

Customization

In the configuration, you can set customize to a function to modify the theme on the fly. This value accepts a function that takes a highlight group name and some options, and returns some options.

The function signature is:

fun(group: string, options: table): table

Where both the options table and the return table are options as described in the nvim_set_hl val parameter.

For instance, in order to disable bold usage on the entire color scheme, you can use

require('anderson').setup({
  customize = function(_, o)
    o.bold = false
    return o
  end,
})

Or if you want to change the coloring from a specific highlight group, in this case set the current line number to a bold orange instead of the default grey:

-- get colors from the colorscheme for current background and "medium" contrast
local colors = require("anderson.colors")

require('anderson').setup({
  customize = function(g, o)
    if g == "CursorLineNr" then
      o.link = nil            -- wipe a potential link, which would take precedence over other
                              -- attributes
      o.fg = colors.orange    -- or use any color in "#rrggbb" hex format
      o.bold = true
    end
    return o
  end,
})

About

Anderson colorscheme for Neovim written in Lua

License:MIT License


Languages

Language:Lua 100.0%