Skip to content

jpwol/thorn.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thorn

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

Dark Warm
Dark Cold
Light Warm
Light Cold

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

Extras Installation

To install additional themes from extras, follow these steps

If installing thorn with a neovim package manager, locate the install location. For lazy, it should be ~/.local/share/nvim/lazy/thorn.nvim, but paths may vary depending on distrobution and configuration.

Otherwise, clone this repository with git clone https://github.com/jpwol/thorn.nvim.

Each application (Ghostty/Kitty/Alacritty/Btop) relies on a themes folder within the ~/.config/<application> directory. If you haven't created that folder within the relevant directory, you can simply copy the themes folder directly. Otherwise, copy the contents of the relevant themes folder to your ~/.config/<application>/themes folder.

# assuming you're in the thorn.nvim directory

# copying the contents of the themes folder
cp extras/ghostty/themes/* ~/.config/ghostty/themes/

# OR copying the folder directly
cp -r extras/ghostty/themes ~/.config/ghostty/

# Additionally, you can create a symbolic link (linux)
cp -s extras/ghostty/themes/* ~/.config/ghostty/themes/

After this, the theme will be available for whichever application you choose, and you can apply it like you normally would.

For ghostty, you can use ghostty +list-themes to preview the themes, and set them in your config file with theme = Thorn <Style> <Background>.

For kitty, you can simply use kitten themes to preview and apply the theme.

For btop, the theme should appear in the settings menu for selection.

For alacritty, you would use

import = [
    # thorn_style_background.toml being one of the 4 provided themes
    "~/.config/alacritty/themes/thorn_style_background.toml"
]

in your alacritty.toml config file.