From 26139670ff005376bd3b07687fb0dc487c1c4e64 Mon Sep 17 00:00:00 2001 From: Taken Date: Mon, 18 Sep 2023 17:29:15 +0200 Subject: [PATCH] Added new user event for loading themes with lazy Signed-off-by: Taken --- lua/taken/functions/themes.lua | 2 ++ lua/taken/plugins/colors.lua | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lua/taken/functions/themes.lua b/lua/taken/functions/themes.lua index e0a9a41..a955ce1 100644 --- a/lua/taken/functions/themes.lua +++ b/lua/taken/functions/themes.lua @@ -1,6 +1,8 @@ local M = {} function M.themeselector() + vim.api.nvim_exec_autocmds("User", { pattern = "ThemeSwitcher", modeline = false }) + local configDir = vim.fn.stdpath("config") local prefsFile = configDir .. "/lua/taken/prefs.lua" local oldstring = 'M.colorscheme = .*"' diff --git a/lua/taken/plugins/colors.lua b/lua/taken/plugins/colors.lua index 0858b1d..8dd41b0 100644 --- a/lua/taken/plugins/colors.lua +++ b/lua/taken/plugins/colors.lua @@ -3,6 +3,7 @@ return { "rose-pine/neovim", name = "rose-pine", priority = 1000, + event = "User ThemeSwitcher", config = function() local rose_pine = require("rose-pine") rose_pine.setup({ @@ -15,11 +16,13 @@ return { "bluz71/vim-nightfly-colors", name = "nightfly", priority = 1000, + event = "User ThemeSwitcher", }, { "catppuccin/nvim", name = "catppuccin", priority = 1000, + event = "User ThemeSwitcher", config = function() local catppuccin = require("catppuccin") catppuccin.setup({ @@ -30,38 +33,47 @@ return { { "folke/tokyonight.nvim", priority = 1000, + event = "User ThemeSwitcher", }, { "Mofiqul/dracula.nvim", priority = 1000, + event = "User ThemeSwitcher", }, { "roflolilolmao/oceanic-next.nvim", priority = 1000, + event = "User ThemeSwitcher", }, { "olimorris/onedarkpro.nvim", priority = 1000, + event = "User ThemeSwitcher", }, { "NTBBloodbath/doom-one.nvim", priority = 1000, + event = "User ThemeSwitcher", }, { "shaunsingh/moonlight.nvim", priority = 1000, + event = "User ThemeSwitcher", }, { "kvrohit/mellow.nvim", priority = 1000, + event = "User ThemeSwitcher", }, { "ofirgall/ofirkai.nvim", priority = 1000, + event = "User ThemeSwitcher", config = true, }, { "rebelot/kanagawa.nvim", priority = 1000, + event = "User ThemeSwitcher", }, }