A port of anderson.vim color scheme for Neovim written in Lua.
- Supported Plugins:
- Treesitter
- Telescope
- LSP Diagnostics
- Nvim Tree
- NERDTree
- Startify
- vim-gitgutter
- undotree
- Vista.vim
- Hop
- WhichKey
- indentLine
- Indent Blankline
- nvim-notify
- vim-illuminate
- nvim-cmp
- And many other plugins you can find here
Note
This plugin requires Neovim >= 0.5.0
Install via your favourite package manager:
Plug 'HASSIIYY/anderson.nvim'
use 'HASSIIYY/anderson.nvim'
{ 'HASSIIYY/anderson.nvim' },
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
})
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,
})