/themer.lua

A simple, minimal highlighter plugin for neovim

Primary LanguageLuaGNU General Public License v3.0GPL-3.0

THEMER - AN ORGANISED COLORSCHEME WORLD

Colorifying neovim editors since 2021

━━━━━━ ❖ ━━━━━━

Credits: Logo by Binx

README WIP

🔧 Installation

    use({
        "themercorp/themer.lua",
	event = "BufEnter",
        config = function()
            require("themer").setup({
                colorscheme = "kanagawa",
                styles = {
			comment = { style = 'italic' },
                  	["function"] = { style = 'italic' }, 
                   	functionbuiltin = { style = 'italic' }, 
                   	variable = { style = 'italic' }, 
                    variableBuiltIn = { style = 'italic' }, 
                  	parameter  = { style = 'italic' }, 
                },
            })
        end
    })
Plug 'themercorp/themer.lua'

Now you can place this base configuration in your init.vim file:

lua << EOF
            require("themer").setup({
                colorscheme = "kanagawa",
                styles = {
                  	["function"] = { style = 'italic' }, 
                   	functionbuiltin = { style = 'italic' }, 
                   	variable = { style = 'italic' }, 
                    variableBuiltIn = { style = 'italic' }, 
                  	parameter  = { style = 'italic' }, 
                },
            })
EOF

or you can also place this in your init.vim file:

colorscheme themer_catppuccin

🍰 Supported Plugins

🌹 Supported colorschemes

Colorschemes Code Names
Catppuccin catppuccin
Rose Pine rose_pine
Rose Pine Moon rose_pine_moon
EverForest everforest
Doom One doom_one
Rose Pine Dawn rose_pine_dawn
Dracula dracula
Papa Dark papa_dark
One Dark onedark
Nord nord
Kurai kurai

This list may not be updated. See lua/themer/modules/themes

🧰 Configuring Themer

Heres the default config table

{
    colorscheme = "rose_pine", -- default colorscheme
    transparent = false,
    term_colors = true,
    dim_inactive = false,
    styles = {
        heading = {
            h1 = {},
            h2 = {},
        },
        ["function"] = {},
        functionBuiltIn = {},
        variable = {},
        variableBuiltIn = {},
        include = {},
        identifier = {},
        keyword = {},
        keywordBuiltIn = {},
        struct = {},
        string = {},
        parameter = {},
        field = {},
        type = {},
        typeBuiltIn = {},
        property = {},
        comment = {},
        punctuation = {},
        constructor = {},
        operator = {},
        constant = {},
        constantBuiltIn = {},
        todo = {},
        character = {},
        conditional = {},
        number = {},
        statement = {},
        uri = {},
        diagnostic = {
            underline = {
                error = {},
                warn = {},
                info = {},
                hint = {},
            },
            virtual_text = {
                error = {},
                warn = {},
                info = {},
                hint = {},
            },
        },
    },
    remaps = {
        palette = {},
        -- per colorscheme palette remaps, for example:
        -- remaps.palette = {
        --     rose_pine = {
        --     	fg = "#000000"
        --     }
        -- },
        -- remaps.highlights = {
        --     rose_pine = { 
	--	base = {
        --     	  Normal = { bg = "#000000" }
       	--	},
       	--     }
        -- },
        --
        -- Also you can do remaps.highlights.globals  for global highlight remaps
        highlights = {},
    },

    langs = {
        html = true,
        md = true,
    },

    plugins = {
        treesitter = true,
        indentline = true,
        barbar = true,
        bufferline = true,
        cmp = true,
        gitsigns = true,
        lsp = true,
        telescope = true,
    },
}

🧸 Extra Goodies

Exporting theme to other stuff

You can export current colorscheme to the following:

  • XResources :lua require("themer.modules.export.xres").write_config()
  • Kitty :lua require("themer.modules.export.kitty").write_config()
  • Alacritty :lua require("themer.modules.export.alacritty").write_config()
  • Compiled Neovim colorscheme :lua require("themer.modules.export.nvim").write_config(require("themer.modules.themes.catppuccin")) (PS: This one needs the color palette as the param)

Using API to access colors

You can use colors api to access color palette of given theme

require("themer.modules.core.api").get_cp("catppuccin")

🧑🏻‍🤝‍🧑🏼 Contributing

Adding more plugin higs

All plugin highlight groups are in modules/core/mapper.lua

Feel free to add new plugin hig groups in availablePlugins table and then tweaking config.options.plugins to add plugin to the list.

Adding new colorscheme

Here's the palette you will need to follow

    -- Legacy colors for compatibility
    red = cpt.red,
    yellow = cpt.yellow,
    orange = cpt.peach,
    magenta = cpt.mauve,
    blue = cpt.blue,
    green = cpt.green,
    cyan = cpt.teal,

    -- The new shiny boy
    fg = cpt.white,
    diff = {
        add = cpt.green,
        remove = cpt.red,
        text = cpt.blue,
        change = cpt.yellow,
    },
    accent = cpt.blue,
    search_result = { fg = cpt.pink, bg = cpt.black4, telescope = cpt.blue },
    match = cpt.white,
    dimmed = {
        inactive = cpt.black4,
        subtle = cpt.gray0,
    },
    bg = {
        base = cpt.black2,
        alt = cpt.black1,
        selected = cpt.black3,
    },
    border = cpt.blue,
    syntax = {
        statement = cpt.mauve,
        ["function"] = cpt.blue,
        variable = cpt.fg,
        include = cpt.pink,
        keyword = cpt.red,
        struct = cpt.yellow,
        string = cpt.green,
        field = cpt.rosewater,
        parameter = cpt.flamingo,
        property = cpt.yellow,
        punctuation = cpt.teal,
        constructor = cpt.lavender,
        operator = cpt.sky,
        preproc = cpt.pink,
        constant = cpt.peach,
        todo = { fg = cpt.black4, bg = cpt.yellow },
        number = cpt.peach,
        comment = cpt.gray0,
        type = cpt.yellow,
        conditional = cpt.pink,
    },
    built_in = {
        ["function"] = cpt.peach,
        type = cpt.yellow,
        variable = cpt.teal,
        keyword = cpt.maroon,
        constant = cpt.lavender,
    },
    diagnostic = {
        error = cpt.red,
        warn = cpt.yellow,
        info = cpt.sky,
        hint = cpt.rosewater,
    },
    inc_search = { fg = "#575268", bg = "#f5c2e7" },
    uri = cpt.flamingo,
    pum = {
        fg = cpt.gray2,
        bg = cpt.black3,
        sbar = cpt.black4,
        thumb = cpt.gray0,
        sel = {
            bg = cpt.black4,
            fg = cpt.white,
        },
    },
    heading = {
        h1 = cpt.pink,
        h2 = cpt.blue,
    },
    remaps = {}, -- all your hig groups remaps go here, follow the structure in core/mapper.lua

Also add the theme name to README and add it to colors/

Porting another vim/neovim theme

You can use lua/themer/modules/import/init.lua to generate color palette and port that theme to themer

Using themer to make your colorscheme plugin

You can use lua/themer/modules/export/nvim.lua to create a single file (with no dependancy on themer) and can use that for creating your colorscheme plugin easily. Also contribute theme palette to themer, if possible.

💚 Credits

Massive shoutouts to the people who supported the project! These are: