diff --git a/init.lua b/init.lua index 7324b73..1516113 100644 --- a/init.lua +++ b/init.lua @@ -14,6 +14,9 @@ if fn.empty(fn.glob(install_path)) > 0 then print "Cloning packer .." fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path } + os.execute("mkdir " .. vim.fn.stdpath "data" .. "/site/pack/packer/start/base46_cache/lua/base46_cache") + require("base46").compile() + -- install plugins + compile their configs vim.cmd "packadd packer.nvim" require "plugins" diff --git a/lua/core/options.lua b/lua/core/options.lua index a097cd7..f224962 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -5,7 +5,6 @@ local config = require("core.utils").load_config() g.nvchad_theme = config.ui.theme g.toggle_theme_icon = "  " g.transparency = config.ui.transparency -g.theme_switcher_loaded = false opt.laststatus = 3 -- global statusline opt.showmode = false diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index 0779579..f9b2633 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -4,7 +4,7 @@ if not present then return end -require("base46").load_highlight "cmp" +require "base46_cache.cmp" vim.o.completeopt = "menu,menuone,noselect" diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index 2f87926..864dd38 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -4,7 +4,7 @@ if not present then return end -require("base46").load_highlight "lsp" +require "base46_cache.lsp" require "nvchad_ui.lsp" local M = {} diff --git a/lua/plugins/configs/mason.lua b/lua/plugins/configs/mason.lua index c713847..3cb85df 100644 --- a/lua/plugins/configs/mason.lua +++ b/lua/plugins/configs/mason.lua @@ -8,7 +8,7 @@ vim.api.nvim_create_augroup("_mason", { clear = true }) vim.api.nvim_create_autocmd("Filetype", { pattern = "mason", callback = function() - require("base46").load_highlight "mason" + require "base46_cache.mason" end, group = "_mason", }) diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua index c4f4fba..4c3910a 100644 --- a/lua/plugins/configs/nvimtree.lua +++ b/lua/plugins/configs/nvimtree.lua @@ -4,7 +4,7 @@ if not present then return end -require("base46").load_highlight "nvimtree" +require "base46_cache.nvimtree" local options = { filters = { diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 9c3786a..ac94fba 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -30,7 +30,7 @@ M.blankline = function() return end - require("base46").load_highlight "blankline" + require "base46_cache.blankline" local options = { indentLine_enabled = 1, @@ -135,7 +135,7 @@ M.gitsigns = function() return end - require("base46").load_highlight "git" + require "base46_cache.git" local options = { signs = { @@ -159,7 +159,7 @@ M.devicons = function() local present, devicons = pcall(require, "nvim-web-devicons") if present then - require("base46").load_highlight "devicons" + require "base46_cache.devicons" local options = { override = require("nvchad_ui.icons").devicons } options = require("core.utils").load_override(options, "kyazdani42/nvim-web-devicons") diff --git a/lua/plugins/configs/telescope.lua b/lua/plugins/configs/telescope.lua index b01abc0..8879b36 100644 --- a/lua/plugins/configs/telescope.lua +++ b/lua/plugins/configs/telescope.lua @@ -4,9 +4,7 @@ if not present then return end -vim.g.theme_switcher_loaded = true - -require("base46").load_highlight "telescope" +require "base46_cache.telescope" local options = { defaults = { diff --git a/lua/plugins/configs/treesitter.lua b/lua/plugins/configs/treesitter.lua index bb1b163..5ae94c8 100644 --- a/lua/plugins/configs/treesitter.lua +++ b/lua/plugins/configs/treesitter.lua @@ -4,7 +4,7 @@ if not present then return end -require("base46").load_highlight "treesitter" +require "base46_cache.treesitter" local options = { ensure_installed = { diff --git a/lua/plugins/configs/whichkey.lua b/lua/plugins/configs/whichkey.lua index 89e7c3e..a24b2ed 100644 --- a/lua/plugins/configs/whichkey.lua +++ b/lua/plugins/configs/whichkey.lua @@ -4,7 +4,7 @@ if not present then return end -require("base46").load_highlight "whichkey" +require "base46_cache.whichkey" local options = { diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index d7831a0..4a0964e 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -29,11 +29,7 @@ local plugins = { ["NvChad/base46"] = { branch = "dev", config = function() - local ok, base46 = pcall(require, "base46") - - if ok then - base46.load_theme() - end + require "base46_cache.defaults" end, },