diff --git a/lua/taken/functions/themes.lua b/lua/taken/functions/themes.lua index aca74cc..e0a9a41 100644 --- a/lua/taken/functions/themes.lua +++ b/lua/taken/functions/themes.lua @@ -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 diff --git a/lua/taken/plugins/colors.lua b/lua/taken/plugins/colors.lua index 6c3d6ea..0858b1d 100644 --- a/lua/taken/plugins/colors.lua +++ b/lua/taken/plugins/colors.lua @@ -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, }, }