Skip to content

sharpchen/Eva-Theme.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eva-Theme.nvim

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

Snipaste_2024-08-14_20-20-16

☀ Light

Snipaste_2024-08-14_17-42-18

🛠 Installation

{
  'sharpchen/Eva-Theme.nvim',
  lazy = false,
  priority = 1000,
}

🎯 Usage

VimScript

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

Lua

vim.cmd('colo Eva-Dark') -- or any variant

⚙ Options

Override palette

Specifiy colors for dark and light variants, specified values will be taken while the rest remains default.

All highlight groups uses certain overrided color will be affected, something unexpected might happen. To override more specificly, use override_highlight

For palette structure, see: palette.lua

require('Eva-Theme').setup({
  override_palette = {
    dark = {
      operator = '#RRGGBB'
      git = {
        diffAdded = '#RRGGBB'
      }
    },
    light = {
      declarative = '#RRGGBB'
    }
  }
})

Override highlight

To customize any highlight group for different variants, you can put function callbacks or tables of key-value pair inside override_highlight.

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,
  },
})

Ambiguity issue

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.logical,
    },
    light = {
      operator = require('Eva-Theme.palette').light_base.logical,
    },
  },
)

Contributing

See: CONTRIBUTING.md