Added new theme switcher and removed lazy loading

This commit is contained in:
2023-09-18 10:39:20 +02:00
parent 7a62a045f4
commit b3523a5857
2 changed files with 15 additions and 40 deletions

View File

@@ -1,37 +1,25 @@
local M = {}
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 prefsFile = configDir .. "/lua/taken/prefs.lua"
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 = {
prompt = "Select a theme",
}
@@ -48,7 +36,6 @@ function M.themeselector()
end
local exec = function(choice)
if choice == nil then
vim.notify("No theme selected!")
return

View File

@@ -3,7 +3,6 @@ return {
"rose-pine/neovim",
name = "rose-pine",
priority = 1000,
lazy = true,
config = function()
local rose_pine = require("rose-pine")
rose_pine.setup({
@@ -16,13 +15,11 @@ return {
"bluz71/vim-nightfly-colors",
name = "nightfly",
priority = 1000,
lazy = true,
},
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
lazy = true,
config = function()
local catppuccin = require("catppuccin")
catppuccin.setup({
@@ -33,47 +30,38 @@ return {
{
"folke/tokyonight.nvim",
priority = 1000,
lazy = true,
},
{
"Mofiqul/dracula.nvim",
priority = 1000,
lazy = true,
},
{
"roflolilolmao/oceanic-next.nvim",
priority = 1000,
lazy = true,
},
{
"olimorris/onedarkpro.nvim",
priority = 1000,
lazy = true,
},
{
"NTBBloodbath/doom-one.nvim",
priority = 1000,
lazy = true,
},
{
"shaunsingh/moonlight.nvim",
priority = 1000,
lazy = true,
},
{
"kvrohit/mellow.nvim",
priority = 1000,
lazy = true,
},
{
"ofirgall/ofirkai.nvim",
priority = 1000,
lazy = true,
config = true,
},
{
"rebelot/kanagawa.nvim",
priority = 1000,
lazy = true,
},
}