Skip to content

AryanRogye/theme-picker.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

theme-picker.nvim 🎨

A powerful interactive theme selector & editor for Neovim.

✨ Features

  • Switch Themes On The Fly - Instantly browse and switch themes
  • Preview before applying – Hover over themes to see how they look
  • Live Theme Editor – Modify highlight groups such as Normal, CursorLine, Comment, etc.
  • Persistent Customization – Your custom theme tweaks are saved across sessions
  • Seamless Keybindings & Commands

Live Theme Editor Live Theme Editor Live Theme Editor

Installation

Using lazy.nvim:

{
    'AryanRogye/theme-picker.nvim',
    config = function()
    end
}

Getting Started

Suggestions

Dependencies

This plugin works with any Neovim theme. The following examples use:

Ensure these plugins are installed for the configurations to work as intended. You can install them using your favorite plugin manager, such as lazy.nvim:

-- Install GruvBox
{
    'morhetz/gruvbox',
    lazy = false
}
-- Install Dark Flat
{
    "sekke276/dark_flat.nvim",
    lazy = false
},
  • Having a centralized location for themes - For Example:
-- File: lua/my-themes.lua
local M = {}

-- Example Themes

M.load_gruvbox = function()
   -- Set GruvBox-specific configurations
       vim.opt.termguicolors = true
   vim.g.gruvbox_contrast_light = 'hard'
   vim.cmd([[colorscheme gruvbox]])
   vim.cmd([[
       highlight Normal guibg=NONE ctermbg=NONE
   ]])
end

M.load_dark_flat = function()
   -- Set dark_flat-specific configurations
   vim.cmd.colorscheme "dark_flat"
end

return M

Using The Plugin

    {
        'AryanRogye/theme-picker.nvim',
        config = function()
--          This is where you load in your themes
--          In the suggestions above it shows how to set something similar
--          There is also an example if you decided not to setup a lua file to load themes
            local theme = require("my-themes")
            require("theme-loader").setup({
--              if this is not set no default theme will need keys or command
                default = 1,    -- default index if no keys set
                themes = {
--                  Load Theme in format name = "" func = func <- Make sure no ()
                    { name = "GruvBox", func = theme.load_gruvbox },
                    { name = "Dark Flat", func = theme.load_dark_flat },
--                  This is if You Directly Want To Load Theme Through Here
--                  { name = "GruvBox", func = function()
--                             Set GruvBox-specific configurations
--                             vim.opt.termguicolors = true
--                             vim.g.gruvbox_contrast_light = 'hard'
--                             vim.cmd([[colorscheme gruvbox]])
--                             vim.cmd([[
--                                highlight Normal guibg=NONE ctermbg=NONE
--                             ]])
--                   end },
                },
                -- Default Values Can Change
                config = {
                    -- How big the bar is
                    ui_col_spacing = 20,
                    opening = "[",
                    closing = "]",
                    selection = "X"
                    -- Preview on j and k
                    preview = true,
                }
            })
            vim.api.nvim_set_keymap("n", "<leader>lu", ":LoadThemeByIndex<CR>", { noremap = true, silent = true })
            vim.api.nvim_set_keymap("n", "<leader>ll", ":LoadThemeByUI<CR>", { noremap = true, silent = true })
            vim.api.nvim_set_keymap("n", "<leader>lp", ":LoadColorPicker<CR>", { noremap = true, silent = true })
            -- Optional
            -- vim.api.nvim_set_keymap("n", "<leader>st", ":SaveThemeState<CR>", { noremap = true, silent = true })
            -- vim.api.nvim_set_keymap("n", "<leader>rt", ":LoadThemeState<CR>", { noremap = true, silent = true })

        end,
    },

Commands

Save Theme State if theme is edited by the user with the color picker

:SaveThemeState

Reset Theme State if theme is edited by the user with the color picker

:ResetThemeState

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published