A semantic coloring code colorscheme for NeoVim ported from Eva-Theme
Supports both Dark and Light modes, with four styles available for each mode: Normal, Bold, Italic, and Italic Bold.
dark | light | semantic |
---|---|---|
function-like names | ||
declaration keywords | ||
parameter name and typeparameter | ||
primitive/builtin type names | ||
type names, arithmetic operators | ||
string context | ||
variable | ||
numbers, constants | ||
flow control keywords, boolean literal, null literal,keyword operators | ||
object members/properties, namespaces/modules | ||
comment | ||
builtin variables like self , super , this , base
|
Note
For implementation downside, Eva-Theme.nvim uses file cache complation to improve loading speed.
Use :EvaCompile
command to compile new cache if necessary.
{
'sharpchen/Eva-Theme.nvim',
lazy = false,
priority = 1000,
build = ':EvaCompile'
}
colo Eva-Dark " or any other variant
" colo Eva-Light
" colo Eva-Dark-Bold
" colo Eva-Light-Bold
" colo Eva-Dark-Italic
" colo Eva-Light-Italic
" colo Eva-Dark-Italic-Bold
" colo Eva-Light-Italic-Bold
vim.cmd('colo Eva-Dark') -- or any variant
Specifiy colors for dark and light variants, specified values will be taken while the rest remains default.
Caution
All highlight groups uses certain overrided color will be affected, something unexpected might happen. To override more specificly, use override_highlight.
Tip
For palette structure, see: palette.lua Or use lazydev.nvim to get full intellisense from type annotations.
require('Eva-Theme').setup({
override_palette = {
dark = {
background = '#14161B',
git = {
diffAdded = '#RRGGBB'
}
},
light = {
declarative = '#RRGGBB'
}
}
})
To customize any highlight group for different variants, you can put function callbacks or tables of key-value pair inside override_highlight
.
Palette
and variant name is available for the function case.
require('Eva-Theme').setup({
override_highlight = {
dark = {
['@foo'] = { fg = '#RRGGBB', bg = '#RRGGBB' },
},
light = {
['@foo'] = { fg = '#RRGGBB', bg = '#RRGGBB' },
},
['@foo'] = function(variant)
return { fg = require('Eva-Theme.utils').is_dark(variant) and '#RRGGBB' or '#RRGGBB' }
end,
LspInlayHint = function(_, palette)
return { fg = palette.comment, bg = nil }
end
},
})
Tip
Value returned from override_highlight
will be merged with the default value. Set certain property to nil
to cancel the default.
Note
Palette
accessible here is the palette override by override_palette
.
This port was intented to respect the upstream where operators got different colors by their usages.
While treesitter parsers generally don't classify operator into different usages, so there's no much I can do.
If you find ambiguity between operator and type(pointer type T*
for example), I suggest customize by yourself.
This is what I prefer:
require('Eva-Theme').setup({
override_palette = {
dark = {
operator = require('Eva-Theme.palette').dark_base.punctuation,
},
light = {
operator = require('Eva-Theme.palette').light_base.punctuation,
},
},
)
See: CONTRIBUTING.md