Added new theme switcher and removed lazy loading
This commit is contained in:
@@ -1,37 +1,25 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.themeselector()
|
function M.themeselector()
|
||||||
local themes = {
|
|
||||||
"rose-pine-main",
|
|
||||||
"rose-pine-moon",
|
|
||||||
"rose-pine-dawn",
|
|
||||||
"catppuccin-mocha",
|
|
||||||
"catppuccin-latte",
|
|
||||||
"nightfly",
|
|
||||||
"tokyonight-night",
|
|
||||||
"tokyonight-storm",
|
|
||||||
"tokyonight-moon",
|
|
||||||
"tokyonight-day",
|
|
||||||
"dracula",
|
|
||||||
"dracula-soft",
|
|
||||||
"OceanicNext",
|
|
||||||
"onelight",
|
|
||||||
"onedark",
|
|
||||||
"onedark_dark",
|
|
||||||
"onedark_vivid",
|
|
||||||
"doom-one",
|
|
||||||
"moonlight",
|
|
||||||
"mellow",
|
|
||||||
"ofirkai",
|
|
||||||
"kanagawa-lotus",
|
|
||||||
"kanagawa-dragon",
|
|
||||||
"kanagawa-wave",
|
|
||||||
}
|
|
||||||
|
|
||||||
local configDir = vim.fn.stdpath("config")
|
local configDir = vim.fn.stdpath("config")
|
||||||
local prefsFile = configDir .. "/lua/taken/prefs.lua"
|
local prefsFile = configDir .. "/lua/taken/prefs.lua"
|
||||||
local oldstring = 'M.colorscheme = .*"'
|
local oldstring = 'M.colorscheme = .*"'
|
||||||
|
|
||||||
|
local colors = vim.fn.globpath(vim.o.rtp, "colors/*", 1, 1)
|
||||||
|
local dataDir = vim.fn.stdpath("data")
|
||||||
|
local newpath = string.gsub(dataDir, "%-", "%%-")
|
||||||
|
local themes = {}
|
||||||
|
|
||||||
|
for i, v in ipairs(colors) do
|
||||||
|
if string.find(v, "lazy") then
|
||||||
|
local filename = string.gsub(v, newpath .. "\\lazy\\.*\\", "")
|
||||||
|
local themename = string.gsub(filename, ".vim", "")
|
||||||
|
local themename2 = string.gsub(themename, ".lua", "")
|
||||||
|
|
||||||
|
table.insert(themes, themename2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
prompt = "Select a theme",
|
prompt = "Select a theme",
|
||||||
}
|
}
|
||||||
@@ -48,7 +36,6 @@ function M.themeselector()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local exec = function(choice)
|
local exec = function(choice)
|
||||||
|
|
||||||
if choice == nil then
|
if choice == nil then
|
||||||
vim.notify("No theme selected!")
|
vim.notify("No theme selected!")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ return {
|
|||||||
"rose-pine/neovim",
|
"rose-pine/neovim",
|
||||||
name = "rose-pine",
|
name = "rose-pine",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
config = function()
|
config = function()
|
||||||
local rose_pine = require("rose-pine")
|
local rose_pine = require("rose-pine")
|
||||||
rose_pine.setup({
|
rose_pine.setup({
|
||||||
@@ -16,13 +15,11 @@ return {
|
|||||||
"bluz71/vim-nightfly-colors",
|
"bluz71/vim-nightfly-colors",
|
||||||
name = "nightfly",
|
name = "nightfly",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
config = function()
|
config = function()
|
||||||
local catppuccin = require("catppuccin")
|
local catppuccin = require("catppuccin")
|
||||||
catppuccin.setup({
|
catppuccin.setup({
|
||||||
@@ -33,47 +30,38 @@ return {
|
|||||||
{
|
{
|
||||||
"folke/tokyonight.nvim",
|
"folke/tokyonight.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Mofiqul/dracula.nvim",
|
"Mofiqul/dracula.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"roflolilolmao/oceanic-next.nvim",
|
"roflolilolmao/oceanic-next.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"olimorris/onedarkpro.nvim",
|
"olimorris/onedarkpro.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"NTBBloodbath/doom-one.nvim",
|
"NTBBloodbath/doom-one.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"shaunsingh/moonlight.nvim",
|
"shaunsingh/moonlight.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kvrohit/mellow.nvim",
|
"kvrohit/mellow.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ofirgall/ofirkai.nvim",
|
"ofirgall/ofirkai.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
config = true,
|
config = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"rebelot/kanagawa.nvim",
|
"rebelot/kanagawa.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = true,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user