jpwol/thorn.nvim

github github
colorschemetreesitter-colorschemes
stars 53
issues 0
subscribers 0
forks 1
CREATED

UPDATED


Thorn is a rich, green theme made to solve two issues with many themes:

Too many highlights

Many themes have a vast amount of highlights, creating a sort of abstract painting when looking at code. Thorn aims to cut down on the amount of different colors with a small palette, making code much more traversable at a glance.

Too high contrast

A lot of dark themes are only dark in the sense of their backgrounds. For those with sensitive eyes, high contrast highlights can be straining after awhile. Thorn mitigates this by using soft, low-contrast highlights that are still easily readable, making a long session much more sustainable on the eyes.

Table of Contents


Previews

Features

[!note] If you want support for a plugin, open an issue and it WILL be added!

Installation

lazy.nvim

{
    "jpwol/thorn.nvim",
    lazy = false,
    priority = 1000,
    opts = {}
}

packer.nvim

use {
    "jpwol/thorn.nvim",
    config = function()
        require("thorn").setup({})
    end,
}

vim-plug

Plug 'jpwol/thorn.nvim', { 'branch': 'main' }

Usage

-- after plugin is loaded by your manager
vim.cmd([[colorscheme thorn]])

For LuaLine

require("lualine").setup({
    options = {
        theme = "thorn" -- "auto" also detects theme automatically
    }
})

Configuration

thorn provides a good amount of customization options, as well as a way to change the color/style of any highlight group of your choosing.

In your plugin setup (lazy.nvim plugin structure used as reference),

return {
    "jpwol/thorn.nvim",
    lazy = false,
    priority = 1000,
    opts = {
        theme = nil, -- 'light' or 'dark' - defaults to vim.o.background if unset
        background = "warm", -- options are 'warm' and 'cold'

        transparent = false, -- transparent background
        terminal = true, -- terminal colors

        styles = {
            keywords = { italic = true, bold = false },
            comments = { italic = true, bold = false },
            strings  = { italic = true, bold = false },

            diagnostic = {
                underline = true, -- if true, flat underlines will be used. Otherwise, undercurls will be used

                -- true will apply the bg highlight, false applies the fg highlight
                error = { highlight = true, },
                hint  = { highlight = false, },
                info  = { highlight = false, },
                warn  = { highlight = false, },
            },
        },

        on_highlights = function(hl, palette) end, -- apply your own highlights
    },
}

Where on_highlights will be a function, and you can edit any highlight group as follows

on_highlights = function(hl, palette)

    -- setting options by member preserves other options for that group
    hl.String.bold = true
    hl.Function.fg = "#D9ADD4"

    -- setting options by table will CLEAR any other options for that group
    hl.Keyword = { fg = "#F9ADA0", italic = true } -- would clear bold and bg if they were set


    -- you can also use the theme's palette
    hl.String.fg = palette.lightgreen
end