Skip to content

Latest commit

 

History

History
484 lines (318 loc) · 12.2 KB

README.md

File metadata and controls

484 lines (318 loc) · 12.2 KB

Ef-Themes

Colourful and legible themes for Neovim, Ported from Ef (εὖ) themes for GNU Emacs By protesilaos

ef-themes-preview

Showcase

Dark Themes

ef-autumn

ef-autumn

ef-bio

ef-bio

ef-cherie

ef-cherie

ef-dark

ef-dark

ef-deuteranopia-dark

ef-deuteranopia-dark

ef-dream

ef-dream

ef-duo-dark

ef-duo-dark

ef-elea-dark

ef-elea-dark

ef-maris-dark

ef-maris-dark

ef-melissa-dark

ef-melissa-dark

ef-night

ef-night

ef-owl

ef-owl

ef-rosa

ef-rosa

ef-symbiosis

ef-symbiosis

ef-trio-dark

ef-trio-dark

ef-tritanopia-dark

ef-tritanopia-dark

ef-winter

ef-winter
Light Themes

ef-arbutus

ef-arbutus

ef-cyprus

ef-cyprus

ef-day

ef-day

ef-deuteranopia-light

ef-deuteranopia-light

ef-duo-light

ef-duo-light

ef-eagle

ef-eagle

ef-elea-light

ef-elea-light

ef-frost

ef-frost

ef-kassio

ef-kassio

ef-light

ef-light

ef-maris-light

ef-maris-light

ef-melissa-light

ef-melissa-light

ef-reverie

ef-reverie

ef-spring

ef-spring

ef-summer

ef-summer

ef-trio-light

ef-trio-light

ef-tritanopia-light

ef-tritanopia-light

Features

  • Fast loading with compiling on a per-need basis

  • 34 Unique themes, ported from Emacs

  • 8 Extras Available for each theme, for a total of 272 extras

  • Close to source. By using a script (see (./lua/ef-themes/lib/parse.lua)) to extract the colors and themes from the original Emacs theme, this port can easily stay up to date with any new themes or modifications.

  • Supports popular plugins. By using the original Emacs themes as source, this theme uses the highlights similar to how they are used in Emacs

📦 Modules
Plugin Source
blink.cmp blink
nvim-cmp cmp
fzf-lua fzf
gitsigns.nvim gitsigns
mini.nvim mini
Neogit neogit
nvim-orgmode orgmode
render-markdown render_markdown
semantic-tokens (native lsp) semantic_tokens
snacks snacks
telescope telescope
treesitter (native) treesitter
which-key.nvim which_key
🎁 Extras
Tool Extra
Fzf extras/fzf
Ghostty extras/ghostty
Kitty extras/kitty
Lazygit extras/lazygit
Vimium extras/vimium
WezTerm extras/wezterm
Windows Terminal extras/windows_terminal
Yazi extras/yazi

Requirements

  • Neovim >= 0.8
  • True color support

Note

The default MacOS terminal does not support truecolor

Installation

lazy.nvim

{ "oonamo/ef-themes.nvim" }

mini.deps

add("oonamo/ef-themes.nvim")

packer.nvim

use { "oonamo/ef-themes.nvim" }

vim-plug

Plug 'oonamo/ef-themes.nvim'

Usage

colorscheme ef-theme " or specify a theme like ef-reverie, ef-owl etc..
vim.cmd.colorscheme("ef-theme") -- or specify a theme like ef-elea-dark

Configuration

require("ef-themes").setup({
  light = "ef-spring", -- Ef-theme to select for light backgrounds
  dark = "ef-winter", -- Ef-theme to select for dark backgrounds
  transparent = false,
  styles = {
    -- Set specific styles for specific highlight groups
    -- Can be any valid attr-list value. See `:h nvim_set_hl`
    comments = { italic = true },
    keywords = { bold = true },
    functions = {},
    variables = {},
    classes = { bold = true },
    types = { bold = true },

    diagnostic = "default", -- Can be "full"
    pickers = "default", -- Can be "borderless"
  },

  modules = {
    -- Enable/Disable highlights for a module
    -- See `h: ef-themes-modules` for the list of available modules
    blink = true,
    fzf = false,
    mini = true,
    semantic_tokens = false,
    snacks = false,
    treesitter = true,
  },

  --- Override any color from the ef-theme
  ---@param colors Ef-Theme
  ---@param name string
  on_colors = function(colors, name) end,

  --- Override specific highlights
  ---@param highlights table
  ---@param colors Ef-Theme
  ---@param name string
  ---@return table
  on_highlights = function(highlights, colors, name)
    -- Returns a table of highlights
    -- return {
    --   Normal = { fg = colors.fg_alt, bg = colors.bg_inactive }
    --   ObscurePlugin = { fg = colors.yellow_faint }
    -- }
  end,

  options = {
    compile = true, -- Whether to compile a theme
    compile_path = vim.fn.stdpath("cache") .. "/ef-themes", -- Directory in which to place compiled themes
  },
})

vim.cmd.colorscheme("ef-theme") -- To use the default colorscheme defined above
-- Or choose a specific theme
-- vim.cmd.colorscheme("ef-dream")

Customizing

Get Ef-theme Palette

local ef_dream = require("ef-themes").get_palette("ef-dream")
local ef_rosa = require("ef-themes").get_palette("ef-rosa")

-- or after require("ef-themes").setup()
local ef_dream = EfThemes.get_palette("ef-dream")
local ef_rosa = EfThemes.get_palette("ef-rosa")

Overwriting Colors

require("ef-themes").setup({
        on_colors = function(colors, name)
            colors.yellow = colors.yellow_faint
            colors.bg_main = "#000000"
        end,
})

Overwriting Highlights

require("ef-themes").setup({
        on_highlights = function(hls, palette, name)
            local overrides = {
                NormalFloat = { fg = palette.fg_main, bg = "NONE" },
                MyObscurePluginHighlight = { fg = hls.DiffAdd.fg }
            }

            local is_dark = require("ef-themes").is_dark(name)
            if is_dark then
                overrides.FloatBorder = { fg = palette.fg_main, bg = palette.bg_inactive }
            else
                overrides.FloatBorder = { fg = palette.fg_main, bg = palette.bg_dim }
            end

            return overrides
        end,
})

Acknowledgments